Part 3-Network Layer
Part 3-Network Layer
Part 3-Network Layer
1. Introduction & Physical Layer - Introduction to the Internet - Services and Protocols, Edge -
Protocol Layers and Service Models OSI and TCP/IP models.
2. Data link Layer - Link Layer – Services - Error Detection and Correction; Multiple Access
protocols Channel partitioning - Random access - Taking-Turns protocols - Switched LANs ARP - Ethernet
- Link layer switching – VLANs – MPLS.
3. Network Layer - Data plane forwarding vs. Control plane routing - Software Defined Networking
(SDN) approach - Network Services - Router architecture - Switching fabrics - Input and output queueing-
Core, Packet Switching vs. Circuit Switching - Performance Metrics Delay - Loss – Throughput - IPv4 and
IPv6 addressing DHCP -NAT - IPv4 and IPv6 fragmentation – SDN-based generalized forwarding -
Routing and Supporting Algorithms - Link State vs. Distance Vector - RIP - OSPF – BGP – ICMP - SNMP
- SDN Control Plane.
4. Transport Layer - Unreliable Connectionless vs. Reliable Connection-Oriented Services -
Multiplexing; Stop-and-Wait - Go-Back-N and Selective-Repeat - UDP vs. TCP - Flow and Congestion
Control.
5. Application Layer - Client-Server and Peer-to-Peer architectures - Application Layer protocols
6. Introduction to Wireless and Mobile Networks - Link characteristics - CDMA - 802.11 WiFi -
Bluetooth and Zigbee - Cellular Networks - GSM – UMTS – LTE - Mobility management and handoff -
Mobile IP.
Part-3 (Lecture Flow & Book Details)
Data plane forwarding vs. Control plane routing - Software Defined Networking (SDN) approach -
Network Services – James Kurose and Keith Ross, “Computer Networking: A Top-down Approach” 7th
edition – Chapter 4- 4.1(Alone)
Router architecture - Switching fabrics -James Kurose and Keith Ross, “Computer Networking: A Top-
down Approach” 6th edition – Chapter 4- 4.3-4.3.1 to 4.3.3(Alone)
Core, Packet Switching vs. Circuit Switching - Performance Metrics Delay - James Kurose and Keith Ross,
“Computer Networking: A Top-down Approach” 6th edition – Chapter 1- 1.3-1.3.1, 1.3.2 and 1.4- 1.4.1-
1.4.3(Alone)
IPv4 - Behrouz Forouzan, “Data Communication and Networking”, Tata McGraw Hill 4th edition. Chapter –
20- only 20.2 and Chapter-19- only 19.1.
IPv6 addressing - IPv4 and IPv6 fragmentation – James Kurose and Keith Ross, “Computer Networking: A
Top-down Approach” 6th edition – Chapter 4- 4.4.4 (Alone)
Routing and Supporting Algorithms - Link State vs. Distance Vector - RIP - OSPF – BGP – Behrouz
Forouzan, “Data Communication and Networking”, Tata McGraw Hill 4th edition. Chapter – 22- only 22.3.
Forwarding and Routing:
• The primary role of the network layer is to move packets from a sending host to a
receiving host.
• Provides host/end/source to host/end/destination communication
• Can be decomposed into two interacting parts: the data plane and the control plane.
4 bytes
20 bytes
An IPv4 packet has arrived with the first 8 bits as shown:
01000010
The receiver discards the packet. Why?
In an IPv4 packet, the value of HLEN is 1000 in binary. How many bytes of
options are being carried by this packet?
In an IPv4 packet, the value of HLEN is 5, and the value of the total length
field is 0x0028. How many bytes of data are being carried by this packet?
An IPv4 packet has arrived with the first few hexadecimal digits as shown.
0x45000028000100000102 . . .
How many hops can this packet travel before being dropped? The data belong to
what upper-layer protocol?
Version = 0100 or 0110
IPv4 datagram format
IHL or HLEN= 4 byte word ( total length of datagram header)
Min= 0101=5X4=20 bytes or max= 1111=15X 4=60 bytes
4 bytes
20 bytes
Maximum transfer unit (MTU)
Fragmentation example
A packet has arrived with an M bit value of 1 and a fragmentation offset value
of 0. Is this the first fragment, the last fragment, or a middle fragment?
A packet has arrived in which the offset value is 100. What is the number of the
first byte? Do we know the number of the last byte?
A packet has arrived in which the offset value is 100, the value of HLEN is 5, and
the value of the total length field is 100. What are the numbers of the first byte
and the last byte?
An IP datagram of size 5920 bytes arrives at a router. The router has to forward this packet to a network
whose maximum transmission unit is 1300 bytes. How many fragments are generated? Find the total length,
more fragment bit and fragment offset for each fragment. Assume IP header size of 20 bytes.
No. of fragments=5900/1280=4.6=5
Fragment 1:
0 to 1279bytes, Fragment offset=0/8=0, Total length=1300 bytes, M=1
Fragment 2:
1280 to 2559bytes, Fragment offset=1280/8=160, Total length=1300 bytes, M=1
Fragment 3:
2560 to 3839bytes, Fragment offset=2560/8=320, Total length=1300 bytes, M=1
Fragment 4:
3840 to 5119bytes, Fragment offset=3840/8=480, Total length=1300 bytes, M=1
Fragment 5:
5120 to 5899bytes, Fragment offset=5120/8=640, Total length=800 bytes, M=0
IPv4 ADDRESSES
• An IPv4 address is 32 bits long.
• The IPv4 addresses are unique and universal.
• The address space of IPv4 is 232 or 4,294,967,296.
Dotted-decimal notation and binary notation for an IPv4 address
• Classful addressing
• Classless addressing
Classless Addressing
In IPv4 addressing, a block of addresses can be defined as
x.y.z.t /n
in which x.y.z.t defines one of the addresses and the /n defines the mask.
• The first address in the block can be found by setting the rightmost
32 − n bits to 0s.
• The last address in the block can be found by setting the rightmost
32 − n bits to 1s.
• The number of addresses in the block can be found by using the formula
232−n.
A block of addresses is granted to a small organization. We know that one of the addresses is 205.16.37.39/28. What is the
first address in the block?
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000 or 205.16.37.32.
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111 or 205.16.37.47
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
Find the first/network address, last/limited broadcast address and number of address
present in a network. The address of one of the device present in the same network is
25.34.12.56/16
n=16
32-n=32-16=16
25.34.0.0
25.34.255.255
2^16
Group 1
For this group, each customer needs 256 addresses. This
means that 8 (log2 256) bits are needed to define each
host. The prefix length is then 32 − 8 = 24. The addresses
are
Group 2
For this group, each customer needs 128 addresses. This
means that 7 (log2 128) bits are needed to define each
host. The prefix length is then 32 − 7 = 25. The addresses
are
Group 3
For this group, each customer needs 64 addresses. This
means that 6 (log264) bits are needed to each host. The
prefix length is then 32 − 6 = 26. The addresses are
4 bytes
20 bytes
Service type or differentiated services
IPv6 Datagram format:
• Expanded addressing capabilities.
• IPv6 increases the size of the IP address from 32 to 128 bits. This ensures that the world won’t
run out of IP addresses.
• In addition to unicast and multicast addresses, IPv6 has introduced a new type of address,
called an anycast address, that allows a datagram to be delivered to any one of a group of
hosts.
• A streamlined 40-byte header.
• IPv4 fields have been dropped or made optional. The resulting 40-byte fixed-length header
allows for faster processing of the IP datagram by a router.
• A new encoding of options allows for more flexible options processing.
• Flow labeling.
• IPv6 has an elusive definition of a flow. RFC 2460 states that this allows “labeling of packets
belonging to particular flows for which the sender requests special handling, such as a non-
default quality of service or real-time service.”
• For ex: audio and video transmission might likely be treated as a flow.
IPv6 Datagram format:
• On the other hand the more traditional applications such as file transfer and e-mail might not
be treated as flows.
• It is possible that the traffic carried by a high-priority user (for ex: someone paying for better
service for their traffic) might also be treated as a flow.
• The following fields are defined in IPv6:
• Version.
• This 4-bit field identifies the IP version number.
• IPv6 carries a value of 6 in this field.
• Traffic class.
• The 8-bit traffic class field, like the TOS field in IPv4, can be used to give priority to certain
datagrams within a flow, or it can be used to give priority to datagrams from certain
applications (for ex: voice-over-IP) over datagrams from other applications (for ex: SMTP e-
mail).
• Flow label.
• 20-bit field is used to identify a flow of datagrams.
IPv6 Datagram format:
• Payload length.
• This 16-bit value is treated as an unsigned integer giving the number of bytes in the IPv6
datagram following the fixed-length, 40-byte datagram header.
• Next header.
• This field identifies the protocol to which the contents (data field) of this datagram will be
delivered (for ex: to TCP or UDP).
• The field uses the same values as the protocol field in the IPv4 header.
• Hop limit.
• The contents of this field are decremented by one by each router that forwards the datagram.
• If the hop limit count reaches zero, the datagram is discarded.
• Source and destination addresses.
• Data.
• This is the payload portion of the IPv6 datagram. When the datagram reaches its destination,
the payload will be removed from the IP datagram and passed on to the protocol specified in
the next header field.
IPv6 Datagram format:
• Several fields appearing in the IPv4 datagram are no longer present in the IPv6 datagram:
• Fragmentation/reassembly.
• IPv6 does not allow for fragmentation and reassembly at intermediate routers; these operations
can be performed only by the source and destination.
• If an IPv6 datagram received by a router is too large to be forwarded over the outgoing link,
the router simply drops the datagram and sends a “Packet Too Big” ICMP error message back
to the sender.
• The sender can then resend the data, using a smaller IP datagram size.
• Fragmentation and reassembly is a time-consuming operation; removing this functionality
from the routers and placing it squarely in the end systems considerably speeds up IP
forwarding within the network.
• Header checksum.
• Because the transport-layer (for ex: TCP and UDP) and link-layer (for ex: Ethernet) protocols
in the Internet layers perform check summing, the designers of IP probably felt that this
functionality was sufficiently redundant in the network layer that it could be removed.
IPv6 Datagram format:
• As with fragmentation and reassembly, this too was a costly operation in IPv4.
• Options.
• An options field is no longer a part of the standard IP header.
• The removal of the options field results in a fixed-length 40-byteIP header.
ROUTING PROTOCOLS
• A routing table can be either static or dynamic.
• A static table is one with manual entries.
• A dynamic table is one that is updated automatically when there is a
change somewhere in the Internet.
• A routing protocol is a combination of rules and procedures that lets
routers in the Internet inform each other of changes.
Distance Vector Routing
• These protocols select the best path based on hop counts to reach a
destination network in a particular direction.
• The router shares its knowledge about the whole network to its neighbors
and accordingly updates the table based on its neighbors.
• Full routing tables are not sent in updates but only distance vector is shared.
• The sharing of information with the neighbors takes place at regular
intervals.
• It makes use of Bellman-Ford Algorithm for making routing tables.
Link State Routing
1 N1 - 2 5 1(N1-
N4)
2 N1,N4 - 2(N1- 4 - 2
N2)
3 N1, N4,N2 - - 4 - 2(N1-N4-
N5)
4 N1,N4,N2,N - - 3(N1- - - 4
5 N4-N5-
N3)
5 N1,N4,N2,N - - - - - 4(N1-N4-
5,N3 N5-N6)
For Practice
Dijkstra algorithm:
1 V1 - 4 6 8
2 V1. V2 - - 5 8 11
3 V1, V2, V3 - -- - 7 10 9
1 V1 - 4 6 8
2 V1. V2 - - 5 8 11
3 V1, V2, V3 - -- - 7 10 9
4 V1, V2, V3, - - - - 10 9
V4
0 - - - - -
0 - - - - - -