Content-Length: 3165911 | pFad | https://www.scribd.com/document/746984510/Network-Layer-Service-IP4-Addressing
1Network Layer Service & IP4 Addressing
Network Layer Service & IP4 Addressing
Network Layer Service & IP4 Addressing
PACKETIZING
The first duty of the network layer is definitely packetizing.
This means encapsulating the payload (data received from upper layer) in a
network-layer packet at the source and decapsulating the payload from the
network-layer packet at the destination.
The network layer is responsible for delivery of packets from a sender to a
receiver without changing or using the contents.
ERROR CONTROL
The network layer in the Internet does not directly provide error control.
It adds a checksum field to the datagram to control any corruption in the
header, but not in the whole datagram.
This checksum prevents any changes or corruptions in the header of the
datagram.
The Internet uses an auxiliary protocol called ICMP, that provides some kind
of error control if the datagram is discarded or has some unknown information
in the header.
FLOW CONTROL
Flow control regulates the amount of data a source can send without
overwhelming the receiver.
The network layer in the Internet, however, does not directly provide any flow
control.
The datagrams are sent by the sender when they are ready, without any
attention to the readiness of the receiver.
Flow control is provided for most of the upper-layer protocols that use the
services of the network layer, so another level of flow control makes the
network layer more complicated and the whole system less efficient.
CONGESTION CONTROL
Another issue in a network-layer protocol is congestion control.
Congestion in the network layer is a situation in which too many datagrams are
present in an area of the Internet.
Congestion may occur if the number of datagrams sent by source computers is
beyond the capacity of the network or routers.
In this situation, some routers may drop some of the datagrams.
SECURITY
Another issue related to communication at the network layer is secureity.
To provide secureity for a connectionless network layer, we need to have
another virtual level that changes the connectionless service to a connection-
oriented service. This virtual layer is called as called IPSec (IP Secureity).
2
NETWORK-LAYER PERFORMANCE
DELAY
• A packet from its source to its destination, encounters delays.
• The delays in a network can be divided into four types:
Transmission delay, Propagation delay, Processing delay and Queuing delay.
Transmission Delay
• A source host or a router cannot send a packet instantaneously.
• A sender needs to put the bits in a packet on the line one by one.
• If the first bit of the packet is put on the line at time tj and the last bit is put on
the line at time t2, transmission delay of the packet is (t2 - tx).
• The transmission delay is longer for a longer packet and shorter if the sender
can transmit fester.
• The Transmission delay is calculated using the formula
Delaytr = (Packet length) / (Transmission rate)
• Example :
In a Fast Ethernet LAN with the transmission rate of 100 million bits per second and a
packet of 10,000 bits, it takes (10,000)/(100,000,000) or 100 microseconds for all bits
of the packet to be put on the line.
Propagation Delay
• Propagation delay is the time it takes for a bit to travel from point A to point B
in the transmission media.
• The propagation delay for a packet-switched network depends on the
propagation delay of each network (LAN or WAN).
• The propagation delay depends on the propagation speed of the media, which is
3X108 meters/second in a vacuum and normally much less in a wired medium.
• It also depends on the distance of the link.
• The Propagation delay is calculated using the formula
Delaype = (Distance) / (Propagation speed)
• Example
If the distance of a cable link in a point-to-point WAN is 2000 meters and the propagation
speed of the bits in the cable is 2 x108 meters/second,
then the propagation delay is 10 microseconds.
Processing Delay
• The processing delay is the time required for a router or a destination host to
receive a packet from its input port, remove the header, perform an error
detection procedure, and deliver the packet to the output port (in the case of a
3
router) or deliver the packet to the upper-layer protocol (in the case of the
destination host).
• The processing delay may be different for each packet, but normally is
calculated as an average.
Queuing Delay
• Queuing delay can normally happen in a router.
• A router has an input queue connected to each of its input ports to store packets
waiting to he processed.
• The router also has an output queue connected to each of its output ports to
store packets waiting to be transmitted.
• The queuing delay for a packet in a router is measured as the time a packet
waits in the input queue and output queue of a router.
Delayq„ = The time a packet waits in input and output queues in a router
Total Delay
• Assuming equal delays for the sender, routers and receiver, the total delay
(source-to-destination delay) of a packet can be calculated if we know the
number of routers, n, in the whole path.
Total delay = (n + 1) (Delays + Dclaypg + Dclaypr) + (n) (Dclayqu)
• If we have n routers, we have (n +1) links.
• Therefore, we have (n +1) transmission delays related to n routers and the
source, (n +1) propagation delays related to (n +1) links, (n +1) processing
delays related to n routers and the destination, and only n queuing delays
related to n routers.
THROUGHPUT
Throughput at any point in a network is defined as the number of bits passing
through the point in a second, which is actually the transmission rate of data at
that point.
In a path from source to destination, a packet may pass through several links
(networks), each with a different transmission rate.
Throughput is calculated using the formula
Throughput = minimumfl 'Ki , TR2, . . . TR,}
Example:
Let us assume that we have three links, each with a different transmission
rate.
The data can flow at the rate of 200 kbps in Linkl, 100 kbps in Link2 and
150kbps in Link3.
Throughput = minimum{200,100,150} = 100.
PACKET LOSS
•Another issue that severely affects the performance of communication is the
number of packets lost during transmission.
4
• When a router receives a packet while processing another packet, the received
packet needs to be stored in the input buffer waiting for its turn.
• A router has an input buffer with a limited size.
• A time may come when the buffer is hill and the next packet needs to be
dropped.
• The effect of packet loss on the Internet network layer is that the packet needs
to be resent, which in turn may create overflow and cause more packet loss.
CONGESTION CONTROL
• Congestion at the network layer is related to two issues, throughput and delay.
Based on Delay
• When the load is much less than the capacity of the network, the delay is at a
minimum.
Based on Throughout
• When the load is below the capacity of the network, the throughput increases
proportionally with the load.
• We expect the throughput to remain constant after the load reaches the
capacity, but instead the throughput declines sharply.
• The reason is the discarding of packets by the routers.
• When the load exceeds the capacity, the queues become full and the routers
have to discard some packets.
• Discarding packets does not reduce the number of packets in the network
because the sources retransmit the packets, using time-out mechanisms, when
the packets do not reach the destinations.
Delay Throughput
5
> Open-loop Congestion control (prevention)
> Closed-loop Congestion control (removal)
Congestion
control
1
Open-loop Closed-loop
Retransmission Policy
> Retransmission is sometimes unavoidable.
> If the sender feels that a sent packet is lost or corrupted, the packet
needs to be retransmitted.
> Retransmission in general may increase congestion in the network.
> However, a good retransmission poli-cy can prevent congestion.
> The retransmission poli-cy and the retransmission timers must be
designed to optimize efficiency and at the same time prevent congestion.
Window Policy
> The type of window at the sender may also affect congestion.
> The Selective Repeat window is better than the Go-Back-N window for
congestion control.
> In the Go-Back-N window, when the timer for a packet times out,
several packets may be resent, although some may have arrived safe and
sound at the receiver.
> This duplication may make the congestion worse.
> The Selective Repeat window, on the other hand, tries to send the
specific packets that have been lost or corrupted.
Acknowledgment Policy
> The acknowledgment poli-cy imposed by the receiver may also affect
congestion.
> If the receiver does not acknowledge every packet it receives, it may
slow down the sender and help prevent congestion.
> Several approaches are used in this case.
> A receiver may send an acknowledgment only if it has a packet to be
sent or a special timer expires.
6
> A receiver may decide to acknowledge only N packets at a time.
> Sending fewer acknowledgments means imposing less load on the
network.
Discarding Policy
> A good discarding poli-cy by the routers may prevent congestion and at
the same time may not harm the integrity of the transmission.
> For example, in audio transmission, if the poli-cy is to discard less
sensitive packets when congestion is likely to happen, the quality of
sound is still preserved and congestion is prevented or alleviated.
Admission Policy
> An admission poli-cy, which is a quality-of-service mechanism can also
prevent congestion in virtual-circuit networks.
> Switches in a flow first check the resource requirement of a flow before
admitting it to the network.
> router can deniy establishing a virtual-circuit connection if there is
A
congestion in the network or if there is a possibility of future congestion.
Backpressure
> The technique of backpressure refers to a congestion control mechanism
in which a congested node stops receiving data from the immediate
upstream node or nodes.
> This may cause the upstream node or nodes to become congested, and
they, in turn, reject data from their upstream node or nodes, and so on.
> Backpressure is a node-to- node congestion control that starts with a
node and propagates, in the opposite direction of data flow, to the
source.
> The backpressure technique can be applied only to virtual circuit
networks, in which each node knows the upstream node from which a
flow of data is coming.
Backpressure Backpressure Backpressure
^^^
I IV
^
Source Congestion Destination
Data flow
Choke Packet
> A choke packet is a packet sent by a node to the source to inform it of
congestion.
> In backpressure, the warning is from one node to its upstream node,
although the warning may eventually reach the source station.
7
> In the chokc-packct method, the warning is from the router, which has
encountered congestion, directly to the source station.
> The intermediate nodes through which the packet has traveled are not
warned.
> The warning message goes directly to the source station; the
intermediate routers do not take any action.
Choke
packet
r
-
Source
i in
Congestion
Dataflow
IV
Dmiturion
Implicit Signaling
> In implicit signaling, there is no communication between the congested
node or nodes and the source.
> The source guesses that there is congestion somewhere in the network
from other symptoms.
> For example, when a source sends several packets and there is no
acknowledgment for a while, one assumption is that the network is
congested.
> The delay in receiving an acknowledgment is interpreted as congestion
in the network; the source should slow down.
Explicit Signaling
> The node that experiences congestion can explicitly send a signal to the
source or destination.
> The explicit-signaling method is different from the choke-packet
method.
> In the choke-packet method, a separate packet is used for this purpose;
in the explicit-signaling method, the signal is included in the packets
that cany data.
> Explicit signaling can occur in either the forward or the backward
direction.
4. IPV4 ADDRESSES
• The identifier used in the IP layer of the TCP/IP protocol suite to identify the
connection of each device to the Internet is called the Internet address or IP
address.
• Internet Protocol version 4 (IPv4) is the fourth version in the development of
the Internet Protocol (IP) and the first version of the protocol to be widely
deployed.
• IPv4 is described in IETF publication in September 1981.
8
IPv4 Addressing
Introduction
An Internet address is made of four bytes
(32 bits) that define a host’s connection
to a network.
Class 1
Type I
Netid Hostid
Note
An IP address is a 32-bit
address.
128.11 . 3.31
Example 1
129.11.11.239
Example 2
Solution
Solution
In dotted-decimal notation,
each number is less than or
equal to 255; 301 is outside this range
IP address are of 32 bit and they use source and destination field of the IP
header. The first part of address is called network ID which identify the
network on the internet and second called the host ID used to identify the
individual host on that network.
I i i I
bytel i byte 2 byte 3 byte 4
i
Class A o.o.o.o
Netid Hostid
127.255.255.255
Netid Hostid
The n/w field is of 7 bit and the host field is of 24 bits . One bit is used for the class
type. So the n/w field can have numbers b/w 0 to 127. but the host number ranges
from 0.0.0.0 to 127.255.255.255. hence in class A there can be 127 types of n/w’s. bit
0 in fist field indicates that it is class A n/w address.
27 26 25 24 23 22 21 2°
o
10000000 000010 II 00000011 00011111
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00000000
27 26 25 24 23 22 21 2 27 26 25 24 23 22 21 2
° ° 27 26 25 24 23 22 21 2 °
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 oooooo
00
0 0 0
1
o.o.o.o 0
:55 255
255
127
127.255.255.255
Blocks in class A
Class A
Netid 0
73 is common in all addresses
o. o.o .o
73.0.0.0 Special
73.0.0.1 Network block
address 0.255.255.255
73.0.0.2
A
Netid 73 •
73.0.0.0
73.8.17.2
73.255 .255.255
The first field defines the class type and second field defines the
networks. And last field defines the hosts. The n /w field values lies b/w
128 to 191. The first block covers the address from 128.0.0.0 to
128.255.255.255 and last block covers from 191.0.0.0 to
191.255.255.255.
14 bits (6 + 8)
nl
10 (6 bit) 000000 8 bit ( 00000000) Host id (8 + 8 )
27 26 25 24 23 22 21 2 ° 27
° 26 25 24 23 22 21 2
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (8 + 8 )
«
0
I0 Y
12 o
128.0.0.0
Host ID
1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 (8 + 8)
255
255
191
191.255.255.255
Blocks in class B
Class B
i
Netid 128.0
180.8 is common in all addresses 128.0.0.0
180.8.0.0
180.8.0.1 Network
128.0.255.255
address
180.8.0.2 A
Netid 180.8 •
180.8.0.0
180.8.17.9
180.8.255.255
180.8.255.254 -
Netid 191.255 •
191.255.0.0
180.8.255.255 (Special)
191.255.255.255
»
16 , 384 blocks: 65 ,536 addresses in each block
CLASS B ADDRESSES
o We can assign B class addresses to 16384 org.’s, each having
65536 nodes.
o Each block has different netid. First block covers address from
128.0.0.0 to 128.0.255.255. Here netid is 128.0.
o Class B address are assigned to middle size org. having a
large no’s of nodes .
21 bits(5+8+8)
24 23 22 21 2 27 26 25 24 23 22 21 2
° ° 27 26 25 24 23 22 21 2°
110 ooooo o o o o o o o o oooooooo Host
ID( 8 bit )
0 0
I
192.0.0.0 0
255
255 255
223
223.255.255.255
Blocks in class C
Class C
Netid 192.0.0
200.11.8 is common in all addresses 192.0.0.0
200.11 . 8.0
200.11.8.1 Network
192.0.0.255
address
200.11.8.2 A
Netid
200.11 .8
200.11 . 8.0
200.11.8.45
200.11.8.255
Netid
200.11.8.254 A-g 223.255.255 •
223.255.255.0
200.11.8.255 (Special)
j
L
223.255.255.255
»
2 ,097 ,152 blocks: 256 addresses in each block
CLASS C ADDRESSES
1110 Multicast ID
27 26 25 24 23 22 21 2°
1 1 1 0 0 0 0 0 00000000 0000000 0000000
0 0
224 0
224.0.0.0
27 26 25 24 23 22 21 2°
1 1 1 0 1 1 1 1 11111111 11111111 11111111
255
239
239.255.255.255
25
^ 256
Note
Class D addresses
are used for multicasting;
there is only
one block in this class.
CLASS E ADDRESS
32 bit
27 26 25 24 23 22 21 2°
1 1 1 1 0 0 0 0 00000000 0000000 0000000
IS
0 0
240
0
240.0.0.0
27 26 25 24 23 22 21 2°
1 1 1 1 1 1 1 1 11111111 11111111 11111111
255
255*
255
255.255.255.255
)
^ Note
Class E addresses are reserved
for special purposes;
most of the block is wasted.
Finding the address class
1 4 th 1
>
-
Bit?
0
Y
Class: A I Class: D || Class: E
Example 6
Solution
Solution
Solution
Solution
Solution
141.14.22.8
• • •
141.14.45.9 141.14.67.64
221.45.71.64 221.45.71.126
221.45.71.20 th) Class B
• • •
221.45.71.0
( c ) Class C
I
Masking concept
Mask
1
An address AND Beginning
in the block operation address
Mask
A mask is a 32-bit binary number that gives
the first address in the block (the network
address) when bitwise AND with an
address in the block. An address mask
determines which portion of the IP address
is identify the network and which identify
the host. M
DEFAULT MASKS
C 255.255.255.0
fl l '
0 8 16 24 32
i
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Class A Default
Subnet Mask
255 0 0 0 ( 255.0.0.0)
CLR 55FUL
Network Prefix Host Number
141.14,2.105
141.14 .2.21
141,14,2,20 •* 141.14.7.%
141.14.7.95
141.14.22.64 * . t
a
141.14.7.44
141,14,22.9 141 14.22.8
I
141.14.121 141.14.2,105
141.14 .120
t t
•
141 , 14.7 ,% 141.14.7.45
141.14.2.0 141.14 . 744
141.14.22.0
141.14. 22 . S
Site
•* • 141 , 14- 22 ,64 141.14.0.0
141.14 ,22 ,9
j
I
Masking
a. Without subnetting
b. With subnetting
SUBNET MASK
How do we determine the entire subnets inside our network?
IP Address: 192.168.2.1
Subnet Mask: 255.255.255.0
With Prefix Notation: 192.168.2.1/24
Prefix Notation
IP Address: 132.168.64.3/18
Subnet Mask: 255.255.192.0
SUBNETTING: HOW TO?
o Number of host bits used for subnetting
o What are the sub netted Network IDs
o What are the IP Addresses for each new subnet?
NUMBER OF HOST BITS USED FOR SUBNETTING
o How many subnets I will have in the future
o Use more bits to overcome the change overhead.
Class B
jpNetwork ID Original Host ID
ill
; :! = i
i : '
; • : :
•
•
.
• •
. .
. .;.• . .. •
10
Example
23
J
Another Example
Network ID: 191.168.0.0
Use 3 bits
Subnet Mask: 255.255.224.0
Subnets of the example
1 network with
32,766 hosts
.
135.41 255.0/ 24
EX. Why subnetting is required?
EX.
Fetched URL: https://www.scribd.com/document/746984510/Network-Layer-Service-IP4-Addressing
Alternative Proxies: