Communication Networks Unit 3
Communication Networks Unit 3
Network layer
Unit: 3
Communication Networks
(ACSE0602)
Dr. Prasanna Kumar Singh
Associate Professor
B Tech (CS) 6th Sem
Department of
Electronics and Communication
Engineering
4/7/2023 2
Dr. Prasanna Singh CN CS Unit-3
Syllabus by University
Course Contents / Syllabus
UNIT-I Introduction 8 Hr
Goals and applications of networks, Categories of networks, Organization of the
Internet, ISP, The OSI reference model, TCP/IP protocol suite, Network devices
and components, Mode of communications
Physical Layer: Network topology design, Types of connections, LAN, MAN and
MAN Transmission media, Signal transmission and encoding, Network
performance and transmission impairments, Switching techniques and
multiplexing, IEEE standards.
UNIT-II Data Link layer 8 Hr
Framing, Error Detection and Correction, Flow control (Elementary Data Link
Protocols, Sliding Window protocols). Medium Access Control and Local Area
Networks: Channel allocation, Multiple access protocols, LAN standards, Link
layer switches & bridges.
• Text Books:
1. B. A. Forouzan, “Data Communications and Networking”, 5th
Edition, TMH, 2017.
• Reference Books:
1. S. Tanenbaum, “Computer Networks”, 4th Edition, Pearson,
2013.
2. W. Stallings, “Data and Computer Communication”, 8th
Edition, Pearson, 2007.
4/7/2023 6
Dr. Prasanna Singh CN CS Unit-3
Course Objective
CO4 Explain the functions offered by session and presentation layer and their
Implementation.
CO5 Explain the different protocols used at application layer i.e. HTTP, SNMP, SMTP,
FTP,TELNET and VPN.
1. Engineering knowledge
2. Problem analysis
3. Design/development of solutions
4. Conduct investigations of complex problems
5. Modern tool usage
6. The engineer and society
7. Environment and sustainability
8. Ethics
9. Individual and team work
10. Communication
11. Project management and finance
12. Life-long learning
CO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1 3 2 2 2 2 2 3
CO2 3 3 2 3
CO3 3 3 3 3 2 2 2 3
CO4 3 2 2 2 3
CO5 3 3 2 2 3 2 3
Course Outcome
Program Specific
Outcomes CO1 CO2 CO3 CO4 C05
2 2 2 2 2
PSO1
2 2 2 2
PSO2
2
2 2 2 3 2
PSO3
AVERAGE 2 2 2 2.3 2
• Knowledge of Computer.
• Video Links
• Summary
• Reference
• Design Issues.
• Routing Algorithms.
• Congestion control Algorithms.
• Internetworking –TCP/IP, IP Packet, IPv4 and IPv6
Protocols,
• IPV4 Addresses,
• Connecting Devices,
• Virtual LAN IPV6 Addresses.
4/7/2023 REC-080
Dr. Prasanna
ElectronicSingh
Switching
CN CS Unit-3 Unit1 18
CO-PO and PSO Mapping
Sr. Course PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
No Outcome
1 CO 1 2 2 2 2 1 2 - - 1 - - 1
2 CO 2 2 2 2 1 1 1 - - - 1 1 2
3 CO 3 2 2 2 1 1 1 - - 1 - 1 2
4 CO 4 2 1 2 1 2 2 - - 1 1 - 2
5 CO 5 2 2 2 2 2 2 1 - - 1 - 1
AVERAGE 2 1.8 2 1.4 1.4 1.6 0.2 0 0.6 0.6 0.4 1.6
Course Outcome
Program Specific Outcomes
CO1 CO2 CO3 CO4 CO5
PSO1 2 1 1 1 2
PSO2 1 2 2 2 1
PSO3 - - - - -
AVERAGE 1 1 1 1 1
Network Layer:
Responsibilities
Logical Addressing
In the internet world, there are two kinds of addressing, data link layer
addressing and logical addressing at the network layer. While physical
addressing at the data link layer is defined by the MAC address of a device,
on the other hand, IP addressing is defined at the network layer of the OSI
model. IP addressing is also known as logical addressing.
The network layer must send messages down to the data link layer for
transmission. The data that network layer receives is in the form of a
packet and the data that data link layer forwards is called a frame
Fragmentation and reassembly have to be done by the network layer
because some data link layer technologies have limits on the length of
any message that can be sent. If the packet that the network layer wants
to send is too large, the network layer must split the packet up, send each
piece to the data link layer, and then have pieces reassembled once they
arrive at the network layer on the destination machine.
Other legacy network layer protocols that are not widely used
include:
• Novell Internetwork Packet Exchange (IPX)
• AppleTalkConnectionless Network Service (CLNS/DECNet)
Classless
addressing
Host id
Host id bits
Mask Mask
255.255.224.0
Perform
AND
Host id bits
operation
Addresses in a NAT
Routing Algorithms-
•Routing algorithms are meant for determining the routing of packets in a node.
•Routing algorithms are classified as-
Dijkstra’s Algorithm:-
3
C 2 E
• Minimization Method- Optimization
• Optimization problem can be solve by Greedy Approach gives Optimum result
• So, it’s a predefined procedure – solve in stages like vertex to vertex approach
• Shortest path from One vertex to every vertices either direct path or via other
vertices
4/7/2023 Dr. Prasanna Singh CN CS Unit-3 150
Example of Dijkstra’s algorithm
Initialize: 2
Note- Select any vertex as source one B D
10
Let A be the source vertex
8
0 A 1 4 7 9
Source Destination
3
Q: A B C D E C 2 E
0
S: {}
3
Q: A B C D E C 2 E
0
S: { A }
3
Q: A B C D E C 2 E
0 3
10 3
S: { A }
3
Q: A B C D E C 2 E
0 3
10 3
S: { A, C }
3
Q: A B C D E C 2 E
0 3 5
10 3
7 11 5
S: { A, C }
3
Q: A B C D E C 2 E
0 3 5
10 3
7 11 5
S: { A, C, E }
3
Q: A B C D E C 2 E
0 3 5
10 3
7 11 5
7 11 S: { A, C, E }
3
Q: A B C D E C 2 E
0 3 5
10 3
7 11 5
7 11 S: { A, C, E, B }
3
Q: A B C D E C 2 E
0 3 5
10 3
7 11 5
7 11 S: { A, C, E, B }
9
4/7/2023 Dr. Prasanna Singh CN CS Unit-3 159
Example of Dijkstra’s algorithm
“D” EXTRACT-MIN(Q): 7 9
2
B D
10
8
0 A 1 4 7 9
3
Q: A B C D E C 2 E
0 3 5
10 3
7 11 5
7 11 S: { A, C, E, B, D }
9
4/7/2023 Dr. Prasanna Singh CN CS Unit-3 160
Summary
To show that the shortest path tree for each node is different, we found
the shortest path tree as seen by node C.
(Border
(Routing (Open Shortest Path First)
Gateway
Information
Protocol)
Protocol)
Step-01:
Each router prepares its routing table. By their local knowledge. each router knows
about-
Step-02:
•Each router exchanges its distance vector with its neighboring routers.
•Each router prepares a new routing table using the distance vectors it has
obtained from its neighbors.
•This step is repeated for (n-2) times if there are n routers in the network.
•After this, routing tables converge / become stable.
4/7/2023 Dr. Prasanna Singh CN CS Unit-3 169
Distance Vector Routing
Consider-
•There is a network consisting of 4 routers.
•The weights are mentioned on the edges.
•Weights could be distances or costs or delays.
At Router A- At Router B-
Destination Distance Next Hop Destination Distance Next Hop
A 0 A A 2 A
B 2 B B 0 B
C ∞ – C 3 C
D 1 D D 7 D
Step-01:
Each router prepares its routing table using its local knowledge.
Routing table prepared by each router is shown below-
At Router A-
At Router B-
Destination Distance Next Hop Destination Distance Next Hop
A 0 A A 2 A
B 2 B B 0 B
C ∞ – C 3 C
D 1 D D 7 D
At Router C- At Router D-
Destination Distance Next Hop Destination Distance Next Hop
A ∞ – A 1 A
B 3 B B 7 B
C 0 C C 11 C
D 11 D D 0 D
4/7/2023 Dr. Prasanna Singh CN CS Unit-3 172
Distance Vector Routing
Step-02:
•Each router exchanges its distance vector obtained in Step-01 with its neighbors.
•After exchanging the distance vectors, each router prepares a new routing table.
At Router A-
•Router A can reach the destination router B via its neighbor B or neighbor D.
•It chooses the path which gives the minimum cost.
•Cost of reaching router B from router A via neighbor B = Cost (A→B) + Cost
(B→B)= 2 + 0 = 2
•Cost of reaching router B from router A via neighbor D = Cost (A→D) + Cost (D→B)
=1+7=8
•Since the cost is minimum via neighbor B, so router A chooses the path via B.
•It creates an entry (2, B) for destination B in its new routing table.
•Similarly, we calculate the shortest path distance to each destination router at every
router.
4/7/2023 Dr. Prasanna Singh CN CS Unit-3 174
Distance Vector Routing
A 0 A
B 2 B
C 5 B
D 1 D
At Router B-
•Cost of reaching destination A from router B = min { 2+0 , 3+∞ , 7+1 } = 2 via A.
•Cost of reaching destination C from router B = min { 2+∞ , 3+0 , 7+11 } = 3 via C.
•Cost of reaching destination D from router B = min { 2+1 , 3+11 , 7+0 } = 3 via A.
A 2 A
B 0 B
C 3 C
D 3 A
At Router C-
A 5 B
B 3 B
C 0 C
D 10 B
At Router D-
•Cost of reaching destination A from router D = min { 1+0 , 7+2 , 11+∞ } = 1 via A.
•Cost of reaching destination B from router D = min { 1+2 , 7+0 , 11+3 } = 3 via A.
•Cost of reaching destination C from router D = min { 1+∞ , 7+3 , 11+0 } = 10 via B.
A 1 A
B 3 A
C 10 B
D 0 D
•Each router exchanges its distance vector obtained in Step-02 with its neighboring
routers.
•After exchanging the distance vectors, each router prepares a new routing table.
At Router A-
A 0 A
B 2 B
C 5 B
D 1 D
At Router B-
•Cost of reaching destination A from router B = min { 2+0 , 3+5 , 3+1 } = 2 via A.
•Cost of reaching destination C from router B = min { 2+5 , 3+0 , 3+10 } = 3 via C.
•Cost of reaching destination D from router B = min { 2+1 , 3+10 , 3+0 } = 3 via A.
A 2 A
B 0 B
C 3 C
D 3 A
At Router C-
A 5 B
B 3 B
C 0 C
D 6 B
At Router D-
•Cost of reaching destination A from router D = min { 1+0 , 3+2 , 10+5 } = 1 via A.
•Cost of reaching destination B from router D = min { 1+2 , 3+0 , 10+3 } = 3 via A.
•Cost of reaching destination C from router D = min { 1+5 , 3+3 , 10+0 } = 6 via A.
A 1 A
B 3 A
C 6 A
D 0 D
We have-
•The value of next hop in the final routing table of router A suggests that only edges
AB and AD are used.
•The value of next hop in the final routing table of router B suggests that only edges
BA and BC are used.
•The value of next hop in the final routing table of router C suggests that only edge
CB is used.
•The value of next hop in the final routing table of router D suggests that only edge
DA is used.
Important Notes-
Note-01:
n Distance Vector Routing,
Only distance vectors are exchanged.
“Next hop” values are not exchanged.
This is because it results in exchanging the large amount of data which consumes more
bandwidth.
Note-02:
Note-03:
Note-04:
Note-05:
Routing tables are prepared total (n-1) times if there are n routers in the given
network.
This is because shortest path between any 2 nodes contains at most n-1 edges if there
are n nodes in the graph.
Note-06:
Choke packet
• `
• `
• `
• `
• `
FIFO queue
Priority queuing
Leaky bucket
A leaky bucket
algorithm
shapes busty
traffic into
fixed-rate
traffic by
averaging the
data rate. It
Leaky bucket implementation
may drop the
packets if the
bucket is full.
Token bucket
https://www.youtube.com/watch?v=ThdO9beHhpA : IP address
https://www.youtube.com/watch?v=G5bhSs-s1cw: TCP/IP
https://www.youtube.com/watch?v=PT06TsYJDsM&t=17s: ATM
• Describe the ATM protocol layers and compare them to OSI protocol
hierarchy.
• Explain the frame format of IPv4? What are the advantages of IPv6 and
IPv4?
• Explain the header format of TCP? How connection is established in TCP?
• Explain the following?
(i) Leaky bucket algorithm (ii) User Datagram Protocol (UDP)
• What are the various causes of Congestion?
• What are the desired properties of routing algorithm?
• Compare IPv4 and IPv6.
• What do you understand by TCP and UDP . Explain.
• Define the terms: MAC address, IP address, Hardware/ Physical address
• What do you understand by ATM? Explain cell header format in ATM and
briefly Describe the four services classes of ATM