CN Network Layer19thjune 2019
CN Network Layer19thjune 2019
TY BTech Trimester-VII
Disclaimer:
a. Information included in these slides came from multiple sources. We have tried our best
to cite the sources. Please refer to the references to learn about the sources, when
applicable.
b. The slides should be used only for preparing notes, academic purposes (e.g. in teaching
a class), and should not be used for commercial purposes.
Unit 2: NETWORK LAYER
• Switching Techniques
5-4
20.11
IPv4 Datagram Format
20.12
IPv4 Datagram Format
20.13
Encapsulation of a small datagram in an Ethernet frame
Solution
There is an error in this packet. The 4 leftmost bits (0100)
show the version, which is correct. The next 4 bits (0010)
show an invalid header length (2 × 4 = 8). The minimum
number of bytes in the header must be 20. The packet has
been corrupted in transmission.
01/24/2025 Computer Network Unit II 16
Maximum transfer unit (MTU)
MTUs for some networks
20.18
Figure 20.10 Flags (3 bits) used in fragmentation
20.19
Figure 20.11 Fragmentation example
20.20
Internet Protocol: IPv4
5-54
• “Class B” Address:
• -An IP address which belongs to class B has the first two bits in the first
octet set to 10, i.e.
• -Class B IP Addresses range from 128.0.x.x to 191.255.x.x. The default
subnet mask for Class B is 255.255.x.x.
• -Class B has 16384 (214) Network addresses and 65534 (216-2) Host
addresses.
• -Class B IP address format is thus:
• 10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH
01/24/2025 Computer Network Unit II 24
Classful Addressing
• “Class C” Address:
• -The first octet of Class C IP address has its first 3 bits set to 110, that is:
• -Class C IP addresses range from 192.0.0.x to 223.255.255.x. The
default subnet mask for Class C is 255.255.255.x.
• -Class C gives 2097152 (221) Network addresses and 254 (28-2) Host
addresses.
• -Class C IP address format is thus:
• 110NNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH
• “Class D” Address:
• -Very first four bits of the first octet in Class D IP addresses are set to 1110,
giving a range of:
• 11100000-11101111
• 224-239
• -Class D has IP address rage from 224.0.0.0 to 239.255.255.255.
• -Class D is reserved for Multicasting. In multicasting data is not destined for
a particular host, that is why there is no need to extract host address from
the IP address, and Class D does not have any subnet mask.
01/24/2025 Computer Network Unit II 26
Classful Addressing
• “Class E” Address:
• -This IP Class is reserved for experimental purposes only for R&D
or Study.
• 11110000-11111111
• 240-255
• -IP addresses in this class ranges from 240.0.0.0 to 255.255.255.254.
• -Like Class D, this class too is not equipped with any subnet mask.
And Operation
5-69
5-59
[IGP] [EGP]
Intradomain routing Interdomain routing
Interior [BGP,IDRP] Exterior
Gateway Protocols Gateway Protocols
[RIP] [OSPF,IS-IS,PNNI]
Dijkstra’s Algorithm
1. Start with the local node (router): the root of the tree.
2. Assign a cost of 0 to this node and make it the first permanent node.
3. Examine each neighbour node of the node that was the last permanent node.
4. Assign a cumulative cost to each node and make it tentative.
5. Among the list of tentative nodes
a. Find the node with the smallest cumulative cost and make it permanent.
b. If a node can be reached from more than one direction
i. Select the direction with the shortest cumulative cost.
6. Repeat steps 3 to 5 until every node becomes permanent.
Dijkstra algorithm
Shortest Path Routing
Dijkstra’s Algorithm
Mark permanent
when shortest node
found
Once permanent
never changed
Tentative label change
Tentative node can
always be search
and relabelled
[IGP] [EGP]
Intradomain routing Interdomain routing
Interior [BGP,IDRP] Exterior
Gateway Protocols Gateway Protocols
[RIP] [OSPF,IS-IS,PNNI]
• Sharing knowledge about the entire AS. Each router shares its knowledge
about the entire AS with neighbours. It sends whatever it has.
From C From A
A to D via C: ACD = AC + CD = 2 + ∞
A to E via C: ACE = AC + CE = 2+4
.(a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.
Computer Networks: Routing 87
Link State Algorithm
Each router must do the following:
1. Discover its neighbors, learn their network address.
2. Measure the delay or cost to each of its neighbors.
3. Construct a packet telling all it has just learned.
4. Send this packet to all other routers.
5. Compute the shortest path to every other router.
(a) A subnet. (b) The link state packets for this subnet.
01/24/2025 Tanenbaum Chapter 5 Network 91
Distributing the Link State Packets
The packet buffer for router B in the previous slide
01/24/2025 92
Routing Information Protocol (RIP)
99
Open Shortest Path First(OSPF)
An autonomous system
OSPF—An Interior Gateway
Routing Protocol (2)
• Too many packets present in (a part of) the network causes packet delay
and loss that degrades performance. This situation is called congestion.
• Since congestion occurs within the network, it is the network layer that
directly experiences it and must ultimately determine what to do with
the excess packets.
• The network and transport layers share the responsibility for handling
congestion.
• Congestion at the network layer is related to two issues, throughput and
delay.
01/24/2025 Computer Network Unit II 112
Congestion
When too much traffic is offered, congestion sets in and performance degrades
01/24/2025
sharply.
Tanenbaum Chapter 5 Network 113
Congestion control refers to techniques and mechanisms that can either prevent
congestion before it happens or remove congestion after it has happened.
• -The difference between flow control and congestion control is that Flow control, in
contrast, relates to the traffic between a particular sender and a particular receiver.
• Its job is to make sure that a fast sender cannot continually transmit data faster than
the receiver is able to absorb it and Congestion control has to do with making sure
the network is able to carry the offered traffic.
• It is a global issue, involving the behavior of all the hosts and routers.
• We can divide congestion control mechanisms into two broad categories: open-loop
congestion control (prevention)and closed-loop congestion control (removal).
01/24/2025
(a) High jitter. (b) Low jitter.
Tanenbaum Chapter 5 Network 126
TCP Congestion Control Algorithms
(a) A leaky bucket with water. (b) a leaky bucket with packets.
01/24/2025 Tanenbaum Chapter 5 Network 128
The Token Bucket Algorithm
5-34
5-34
(a) Host 3 requests a channel to host 1. (b) Host 3 then requests a second channel, to
host 2. (c) Host 5 requests a channelTanenbaum
01/24/2025
to host 1.
Chapter 5 Network 133
Expedited Forwarding
Expedited packets experience a traffic-free network.
What is routing? Explain the difference between link state routing and distance vector routing
Consider any class-B network with default subnet mask. How many actual hosts can be connected in that network?
Divide that network into 8 equal subnets?
What is the new subnet mask?
What is the starting address of the 4th Subnet?
What is the last address of the 4e Subnet?
How many hosts can be connected in each subnet? (Give all details).
Explain stepwise the procedure carried out by DHCP client and DHCP Server. Draw diagrams showing the above communication
For a any given class B network with default subnet mask, how many host can be accommodated I each network. How can you divide into 4 equals
subnet? How many hosts can be accommodated in each sub-network?