SlideShare a Scribd company logo
1 of 20
CS2005
Networks and Operating Systems
Network Layer
J.F Kurose and K.W. Ross ©1996-2016
Session objectives
To understand:
• The Network layer key functions
• Forwarding / Routing
• Routing algorithms
• Internet Protocol (IPv4)
• IPv4 datagram format
• IPv4 datagram fragmentation
• IPv4 addressing
• Internet Protocol (IPv6)
• Overview
Network layer
• Network layer protocol provides for logical communication between hosts.
• The network layer can be decomposed into two interacting parts, the data plane
and the control plane.
• The data plane functions include per-router functions in the network layer that
determine how a datagram arriving on one of a router’s input links is forwarded
to one of that router’s output links.
• The control plane functions include the network-wide logic that controls how a
datagram is routed among routers along an end-to-end path from the source
host to the destination host (using routing algorithms).
• Traditionally, the control plane routing protocols and the data plane forwarding
functions have been implemented together, monolithically, within a router.
• Software-defined networking (SDN) explicitly separates the data plane and the
control plane by implementing the control plane functions as a separate service,
e.g. in a remote “controller.”
Network layer (continued)
• The network layer protocols run in every host and
router.
• On the sending side, the network layer takes
segments from the transport layer, encapsulates each
segment into a datagram, and then sends the
datagrams to its nearby router.
• On the receiving side, the network layer receives the
datagrams from its nearby router, extracts the
transport layer segments, and delivers the segments
up to the transport layer.
Two key network layer functions
Forwarding
• When a packet arrives at a router’s input link, the router must move the packet
to the appropriate output link.
• For example, a packet arriving from a host to the nearby router must be
forwarded to the next router on a path. Forwarding is the most common and
important one function in the data plane. Other functions include blocking
packets from exiting a router (if, for example, the packet originated at a known
malicious sending host, or is destined to a forbidden destination host) or
duplicating packets and sent over multiple outgoing links.
Routing
• The network layer must determine the route or path taken by packets as they
flow from a sender to a receiver.
• The algorithms that calculate these paths are referred to as routing algorithms.
• Routing is implemented in the control plane of the network layer.
Forwarding and Routing
• Forwarding refers to the router-local action of transferring a packet from an input link
interface to the appropriate output link interface. Forwarding takes place at very short
timescales (typically a few nanoseconds), and thus is typically implemented in
hardware.
• Routing refers to the network-wide process that determines the end-to-end paths
that packets take from source to destination. Routing takes place on much longer
timescales (typically seconds), and is often implemented in software.
• A key element in every network router is its forwarding table. A router forwards a
packet by examining the value of one or more fields in the arriving packet’s header,
and then using these header values to index into its forwarding table. The value stored
in the forwarding table entry for those values indicates the outgoing link interface at
that router to which that packet is to be forwarded.
So, how the router’s forwarding
tables are configured?
Traditional approach
• The routing algorithm that determines the contents of the routers’ forwarding
tables runs in each and every router and both forwarding and routing functions
are contained within a router.
• The routing algorithm function in one router communicates with the routing
algorithm function in other routers to compute the values for its forwarding
table.
• How is this communication performed?
• By exchanging routing messages containing routing information according to a
routing protocol.
So, how the router’s forwarding
tables are configured?
SDN approach
• The routing algorithm that determines the contents of the routers’ forwarding
tables runs in a physically separated remote controller that computes and
distributes the forwarding tables to be used by each and every router.
• The routing device performs forwarding only, while the remote controller
computes and distributes forwarding tables. The remote controller might be
implemented in a remote data centre with high reliability and redundancy, and
might be managed by the ISP or some third party.
• How might the routers and the remote controller communicate?
• By exchanging messages containing forwarding tables and other pieces of
routing information.
Router architecture
• A router consists of four router components.
Input ports. An input port performs the physical layer function of terminating an incoming
physical link at a router.
• An input port also performs link layer functions needed to interoperate with the link
layer at the other side of the incoming link.
• It also performs a lookup function where the forwarding table is consulted to determine
the router output port to which an arriving packet will be forwarded via the switching
fabric.
• Control packets (for example, packets carrying routing protocol information) are
forwarded from an input port to the routing processor.
• The number of ports supported by a router can range from a relatively small number in
enterprise routers to hundreds of high speed ports in a router at an ISP’s edge.
Router architecture (continued)
Switching fabric. The switching fabric connects the router’s input ports to its output ports.
This switching fabric is completely contained within the router.
Output ports. An output port stores packets received from the switching fabric and
transmits these packets on the outgoing link by performing the necessary link-layer and
physical-layer functions.
Routing processor. The routing processor performs control plane functions.
• In traditional routers, it executes the routing protocols, maintains routing tables and
attached link state information, and computes the forwarding table for the router.
• In SDN routers, the routing processor is responsible for communicating with the remote
controller in order to (among other activities) receive forwarding table entries computed
by the remote controller, and install these entries in the router’s input ports.
• The routing processor also performs the network management functions.
Routing algorithms
• The goal of a routing algorithm is to determine “good” paths (routes) from senders to
receivers through the network of routers. A path is the sequence of routers packets will
traverse in going from source to destination. A good path is the one that has the least cost
(fastest, least congested, etc).
graph: G = (N,E) – nodes and edges
N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
cost of link c(w,z) = 5
cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)
Graph abstraction of a network
• Routing algorithms can be classified as:
• Centralised: all routers have the complete
topology of a network (“link state” algorithms),
or
• Decentralised: a router knows only the physical
connected neighbouring routers (“distance
vector” algorithms).
• Static: routes change very slowly over time.
• Dynamic: change the routing paths as the
network traffic loads or topology change.
• Load-sensitive: link costs vary dynamically to
reflect the current level of congestion in the
underlying link.
• Load insensitive: a link’s cost does not explicitly
reflect its current (or recent past) level of
congestion.
IPv4 datagram format
• There are two versions of the Internet Protocol, IPv4 and IPv6.
• The key fields of the IPv4 datagram are:
• Version number. A 4-bit number that specifies the IP protocol version of the datagram. IPv4 and IPv6
have datagram formats. By looking at the version number, the router can determine how to interpret
the remainder of the IP datagram.
• Header length. Because an IPv4 datagram can contain a variable number of options, the 4-bits header
length is needed to determine where the payload begins. Most IP datagrams do not contain options,
so the typical IP datagram has a 20-byte header.
• Type of service. The 8-bit type of service (TOS) number allows to distinguish
the different types of IP datagrams (e.g. real time / non-real time) and
request services (e.g. priority, route for low-delay, high-throughput, etc.).
• Datagram length. This is the total length of the IP datagram (header plus
data), measured in bytes. Since this field is 16 bits long, the theoretical
maximum size of the IP datagram is 65,535 bytes. However, datagrams are
rarely larger than 1,500 bytes.
• Identifier, flags, fragmentation offset. These three fields keep information
needed for IP fragmentation.
• Time-to-live. The time-to-live (TTL) field is included to ensure that datagrams
do not circulate forever. TTL is decremented by one each time the datagram
is processed by a router. If the TTL field reaches 0, a router must drop that
datagram.
IPv4 datagram format (continued)
• Upper layer protocol. This field is typically used only when an IP datagram reaches its final destination.
The value of this field indicates the specific transport-layer protocol to which the data portion of this IP
datagram should be passed. For example, TCP is 6, UDP is 17 (see IANA Protocol Numbers
https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). The protocol number is
the link between the network layer and the transport layer.
• Header checksum. It aids a router in detecting bit errors in a received IP datagram. Routers typically
discard datagrams with detected errors. The checksum must be recomputed and stored again at each
router, since the TTL field, and possibly the options field as well, will change.
• Source and destination IP addresses. When a source creates a datagram, it inserts its IP address into the
source IP address field and inserts the address of the ultimate destination into the destination IP address
field.
• Options. The options fields allow an IP header to be extended. Header options
are not used frequently. The possible variable header length complicates the
datagram processing in routers.
• Data (payload). In most circumstances, the data field of the IP datagram
contains the transport-layer segment (TCP or UDP) to be delivered to the
destination. However, the data field can carry other types of data, such as ICMP
messages.
An IP datagram has a total of 20 bytes of header (assuming no options). If the
datagram carries a TCP segment, then each (non-fragmented) datagram carries a
total of 40 bytes of header (20 bytes of IP header plus 20 bytes of TCP header)
along with the application-layer message.
IPv4 datagram fragmentation
• IP datagram is encapsulated within the link layer frame for transport from one router to the next
router.
• Not all link layer protocols can carry network layer packets of the same size.
• The maximum amount of data that a link-layer frame can carry is called the maximum transmission
unit (MTU). Therefore, the MTU limits the IP datagram size.
• Each of the links along the route between source and destination can use different link layer
protocols, and each of these protocols can have different MTUs.
• So, how can a router transmit an IP datagram that cannot fit into the payload of the link layer frame?
• IP fragments the payload in the IP datagram into smaller IP datagrams. These are encapsulated in
separate link layer frames and these frames are sent over the outgoing link. Each of these smaller
datagrams is called a fragment.
• When a datagram is created, the sending host stamps the datagram
with an identification number as well as source and destination
addresses.
• When a router needs to fragment a datagram, each resulting
datagram (fragment) is stamped with the source address, destination
address, and identification number of the original datagram.
• When the destination receives a series of datagrams from the same
sending host, it can examine the identification numbers of the
datagrams to determine which of the datagrams are fragments of the
same larger datagram.
IPv4 datagram reassembly
• Received fragments from the same sender and with same identification number belong to the same
datagram.
• IP is unreliable, so fragments of the same datagram may get lost or arrive our of order. So, in order
the destination to be sure that it has received all fragments of the original datagram, the last fragment
has the flag bit set to 0.
• Apart from the last fragment, the destination needs to put the fragments in order and determine
whether a fragment is missing. For this reason, the offset field is used to specify where the fragment
fits within the original IP datagram.
Example
• A datagram of 4,000 bytes (20 bytes of IP header plus 3,980 bytes of IP payload) arrives at a router
and must be forwarded to a link with an MTU of 1,500 bytes.
• 3,980/1,500 = 2.65 so it can fit in 3 fragments.
• 2 x (1,480 (payload) + 20 (header)) and 1 x (1,020 + 20).
• Offset value for the first fragment is always 0.
• Offset is specified in 8-byte blocks.
• Offset value for the second fragment will be 0+ (1480 / 8).
• Offset value for the third fragment will be 185 +(1480 / 8) .
• Previous Offset + Previous Fragment Data transmitted/8).
IPv4 addressing
• Typically, a host has only a single link into the network.
• Because a router’s job is to receive a datagram on one link and forward the datagram on
some other link, a router necessarily has two or more links to which it is connected.
• The boundary between the both the host and router and any one of their links is called an
interface.
• Because every host and router can send and receive IP datagrams, each host and router
interface needs to have its own IP address. Thus, an IP address is technically associated
with an interface rather than with the host or router containing that interface.
• Each IP address is 32 bits long. There are in total of 2^32 (~4 billion) possible IP addresses.
• IP addresses are written in dotted-decimal notation, in which each byte of the address is
written in its decimal form and is separated by a period (dot).
• For example, considering the IP address 193.32.216.9, the 193 is the decimal equivalent of
the first 8 bits of the address, the 32 of the second 8 bits and so on. The binary notation is
11000001 00100000 11011000 00001001.
IPv4 addressing (continued)
• IP addresses cannot be chosen anyhow.
• A portion of an interface’s IP address will be determined by the subnet to which it is
connected. In IP terms, this network interconnecting many host interfaces and one router
interface forms a subnet.
• IP addressing assigns an address to a subnet, e.g. 223.1.1.0/24, where the /24 (“slash-24”)
notation, sometimes known as a subnet mask, indicates that the leftmost 24 bits of the
32-bit quantity define the subnet address.
• Let’s say that there are 2 hosts and a router connected to the above subnet with IP
addresses 223.1.1.2, 223.1.1.5 and 223.1.4, respectively.
• The 223.1.1.0/24 subnet therefore consists of the two host interfaces (223.1.1.2 and
223.1.1.5) and one router interface (223.1.1.4).
• Any additional hosts attached to the 223.1.1.0/24 subnet would be required to have an
address of the form 223.1.1.xxx.
• Network classes: Class A subnet mask /8 - Class B subnet mask /16 and Class C subnet
mask /24.
IPv4 addressing (continued)
• The Internet’s address assignment strategy is known as Classless Interdomain
Routing (CIDR) [RFC 4632].
• The 32-bit IP address is divided into two parts and again has the dotted-decimal form
a.b.c.d/x, where x indicates the number of bits in the first part of the address.
• The x most significant bits of an address of the form a.b.c.d/x constitute the network
portion of the IP address, and are often referred to as the prefix (or network prefix)
of the address.
• An organization is typically assigned a block of contiguous addresses, that is, a range
of addresses with a common prefix
IPv6 overview
• Main motivation for IPv6 was the realisation that the 32-bit IPv4 address space
was beginning to be used up.
• The most important changes are:
• Expanded addressing capabilities. IPv6 IP address are 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 fixed 40-byte header. As discussed below, a number of 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.
Session objectives
To understand:
• The Network layer key functions
• Forwarding / Routing
• Forwarding and Routing: The Data and Control Planes
• What’s Inside a Router? (Overview and Input Port Processing
and Destination-Based Forwarding ONLY)
• Routing algorithms
• Routing Algorithms (Overview ONLY)
• Internet Protocol (IPv4)
• The Internet Protocol (IP): IPv4, Addressing, IPv6, and More
(Overview, IPv4 Datagram Format, IPv4 Datagram Fragmentation,
IPv4 Addressing ONLY)
• Internet Protocol (IPv6)
• IPv6 (Overview and IPv6 Datagram Format ONLY)

More Related Content

Similar to 06.CS2005-NetworkLayer-2021_22(1) (1).pptx

UNIT-3 network security layers andits types
UNIT-3 network security layers andits typesUNIT-3 network security layers andits types
UNIT-3 network security layers andits typesgjeyasriitaamecnew
 
Unit-3-Part-1 [Autosaved].ppt
Unit-3-Part-1 [Autosaved].pptUnit-3-Part-1 [Autosaved].ppt
Unit-3-Part-1 [Autosaved].pptRamya Nellutla
 
Network layer Part 7
Network layer Part 7Network layer Part 7
Network layer Part 7Tutun Juhana
 
Networking and Internetworking Devices
Networking and Internetworking DevicesNetworking and Internetworking Devices
Networking and Internetworking Devices21viveksingh
 
Routing algorithms mehodology materials doc1
Routing algorithms mehodology materials doc1Routing algorithms mehodology materials doc1
Routing algorithms mehodology materials doc1Mugabo4
 
Lecture number 5 Theory.pdf(machine learning)
Lecture  number  5 Theory.pdf(machine learning)Lecture  number  5 Theory.pdf(machine learning)
Lecture number 5 Theory.pdf(machine learning)ZainabShahzad9
 
Routing protocols.pptx
Routing protocols.pptxRouting protocols.pptx
Routing protocols.pptxMNSUAM
 
Et3003 sem2-1314-9 network layers vi (routing protocols)
Et3003 sem2-1314-9 network layers vi (routing protocols)Et3003 sem2-1314-9 network layers vi (routing protocols)
Et3003 sem2-1314-9 network layers vi (routing protocols)Tutun Juhana
 
Computer networks unit iii
Computer networks    unit iiiComputer networks    unit iii
Computer networks unit iiiJAIGANESH SEKAR
 
3 ip routing eigrp
3 ip routing eigrp3 ip routing eigrp
3 ip routing eigrpSagarR24
 
Network layer new
Network layer newNetwork layer new
Network layer newreshmadayma
 
Acn Experiment No 2
Acn Experiment No 2Acn Experiment No 2
Acn Experiment No 2Garima Singh
 

Similar to 06.CS2005-NetworkLayer-2021_22(1) (1).pptx (20)

UNIT-3 network security layers andits types
UNIT-3 network security layers andits typesUNIT-3 network security layers andits types
UNIT-3 network security layers andits types
 
Unit-3-Part-1 [Autosaved].ppt
Unit-3-Part-1 [Autosaved].pptUnit-3-Part-1 [Autosaved].ppt
Unit-3-Part-1 [Autosaved].ppt
 
Routing algorithms
Routing algorithmsRouting algorithms
Routing algorithms
 
Network layer Part 7
Network layer Part 7Network layer Part 7
Network layer Part 7
 
Networking and Internetworking Devices
Networking and Internetworking DevicesNetworking and Internetworking Devices
Networking and Internetworking Devices
 
Routing algorithms mehodology materials doc1
Routing algorithms mehodology materials doc1Routing algorithms mehodology materials doc1
Routing algorithms mehodology materials doc1
 
Lecture number 5 Theory.pdf(machine learning)
Lecture  number  5 Theory.pdf(machine learning)Lecture  number  5 Theory.pdf(machine learning)
Lecture number 5 Theory.pdf(machine learning)
 
Routing protocols.pptx
Routing protocols.pptxRouting protocols.pptx
Routing protocols.pptx
 
Network layer (Unit 3) part1.pdf
Network  layer (Unit 3) part1.pdfNetwork  layer (Unit 3) part1.pdf
Network layer (Unit 3) part1.pdf
 
Routing
RoutingRouting
Routing
 
Et3003 sem2-1314-9 network layers vi (routing protocols)
Et3003 sem2-1314-9 network layers vi (routing protocols)Et3003 sem2-1314-9 network layers vi (routing protocols)
Et3003 sem2-1314-9 network layers vi (routing protocols)
 
Computer networks unit iii
Computer networks    unit iiiComputer networks    unit iii
Computer networks unit iii
 
3 ip routing eigrp
3 ip routing eigrp3 ip routing eigrp
3 ip routing eigrp
 
Group 1
Group 1Group 1
Group 1
 
Golu
GoluGolu
Golu
 
Golu
GoluGolu
Golu
 
Network layer new
Network layer newNetwork layer new
Network layer new
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
CN UNIT III.pptx
CN UNIT III.pptxCN UNIT III.pptx
CN UNIT III.pptx
 
Acn Experiment No 2
Acn Experiment No 2Acn Experiment No 2
Acn Experiment No 2
 

Recently uploaded

Hyundai World Rally Team in action at 2024 WRC
Hyundai World Rally Team in action at 2024 WRCHyundai World Rally Team in action at 2024 WRC
Hyundai World Rally Team in action at 2024 WRCHyundai Motor Group
 
VDA 6.3 Process Approach in Automotive Industries
VDA 6.3 Process Approach in Automotive IndustriesVDA 6.3 Process Approach in Automotive Industries
VDA 6.3 Process Approach in Automotive IndustriesKannanDN
 
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...shivangimorya083
 
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptx
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptxUNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptx
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptxDineshKumar4165
 
(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR
(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR
(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCRsoniya singh
 
UNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.pptUNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.pptDineshKumar4165
 
( Best ) Genuine Call Girls In Mandi House =DELHI-| 8377087607
( Best ) Genuine Call Girls In Mandi House =DELHI-| 8377087607( Best ) Genuine Call Girls In Mandi House =DELHI-| 8377087607
( Best ) Genuine Call Girls In Mandi House =DELHI-| 8377087607dollysharma2066
 
Vip Sonam Hire Hot and Sexy Ahmedabad Call Girls from the Most Reliable Agency
Vip Sonam Hire Hot and Sexy Ahmedabad Call Girls from the Most Reliable AgencyVip Sonam Hire Hot and Sexy Ahmedabad Call Girls from the Most Reliable Agency
Vip Sonam Hire Hot and Sexy Ahmedabad Call Girls from the Most Reliable Agencyoolala9823
 
UNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLESUNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLESDineshKumar4165
 
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...Hot Call Girls In Sector 58 (Noida)
 
The 10th anniversary, Hyundai World Rally Team's amazing journey
The 10th anniversary, Hyundai World Rally Team's amazing journeyThe 10th anniversary, Hyundai World Rally Team's amazing journey
The 10th anniversary, Hyundai World Rally Team's amazing journeyHyundai Motor Group
 
Call me @ 9892124323 Call Girl in Andheri East With Free Home Delivery
Call me @ 9892124323 Call Girl in Andheri East With Free Home DeliveryCall me @ 9892124323 Call Girl in Andheri East With Free Home Delivery
Call me @ 9892124323 Call Girl in Andheri East With Free Home DeliveryPooja Nehwal
 
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一hnfusn
 
call girls in G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
办理埃默里大学毕业证Emory毕业证原版一比一
办理埃默里大学毕业证Emory毕业证原版一比一办理埃默里大学毕业证Emory毕业证原版一比一
办理埃默里大学毕业证Emory毕业证原版一比一mkfnjj
 
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service ManualJohn Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service ManualExcavator
 
(COD) ̄Young Call Girls In Dwarka , New Delhi꧁❤ 7042364481❤꧂ Escorts Service i...
(COD) ̄Young Call Girls In Dwarka , New Delhi꧁❤ 7042364481❤꧂ Escorts Service i...(COD) ̄Young Call Girls In Dwarka , New Delhi꧁❤ 7042364481❤꧂ Escorts Service i...
(COD) ̄Young Call Girls In Dwarka , New Delhi꧁❤ 7042364481❤꧂ Escorts Service i...Hot Call Girls In Sector 58 (Noida)
 
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 person
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 personDelhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 person
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 personshivangimorya083
 

Recently uploaded (20)

Hyundai World Rally Team in action at 2024 WRC
Hyundai World Rally Team in action at 2024 WRCHyundai World Rally Team in action at 2024 WRC
Hyundai World Rally Team in action at 2024 WRC
 
VDA 6.3 Process Approach in Automotive Industries
VDA 6.3 Process Approach in Automotive IndustriesVDA 6.3 Process Approach in Automotive Industries
VDA 6.3 Process Approach in Automotive Industries
 
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
 
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptx
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptxUNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptx
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptx
 
(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR
(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR
(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR
 
UNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.pptUNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
 
( Best ) Genuine Call Girls In Mandi House =DELHI-| 8377087607
( Best ) Genuine Call Girls In Mandi House =DELHI-| 8377087607( Best ) Genuine Call Girls In Mandi House =DELHI-| 8377087607
( Best ) Genuine Call Girls In Mandi House =DELHI-| 8377087607
 
Vip Sonam Hire Hot and Sexy Ahmedabad Call Girls from the Most Reliable Agency
Vip Sonam Hire Hot and Sexy Ahmedabad Call Girls from the Most Reliable AgencyVip Sonam Hire Hot and Sexy Ahmedabad Call Girls from the Most Reliable Agency
Vip Sonam Hire Hot and Sexy Ahmedabad Call Girls from the Most Reliable Agency
 
Hotel Escorts Sushant Golf City - 9548273370 Call Girls Service in Lucknow, c...
Hotel Escorts Sushant Golf City - 9548273370 Call Girls Service in Lucknow, c...Hotel Escorts Sushant Golf City - 9548273370 Call Girls Service in Lucknow, c...
Hotel Escorts Sushant Golf City - 9548273370 Call Girls Service in Lucknow, c...
 
UNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLESUNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLES
 
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...
 
The 10th anniversary, Hyundai World Rally Team's amazing journey
The 10th anniversary, Hyundai World Rally Team's amazing journeyThe 10th anniversary, Hyundai World Rally Team's amazing journey
The 10th anniversary, Hyundai World Rally Team's amazing journey
 
Call me @ 9892124323 Call Girl in Andheri East With Free Home Delivery
Call me @ 9892124323 Call Girl in Andheri East With Free Home DeliveryCall me @ 9892124323 Call Girl in Andheri East With Free Home Delivery
Call me @ 9892124323 Call Girl in Andheri East With Free Home Delivery
 
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一
 
call girls in G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
办理埃默里大学毕业证Emory毕业证原版一比一
办理埃默里大学毕业证Emory毕业证原版一比一办理埃默里大学毕业证Emory毕业证原版一比一
办理埃默里大学毕业证Emory毕业证原版一比一
 
Call Girls in Shri Niwas Puri Delhi 💯Call Us 🔝9953056974🔝
Call Girls in  Shri Niwas Puri  Delhi 💯Call Us 🔝9953056974🔝Call Girls in  Shri Niwas Puri  Delhi 💯Call Us 🔝9953056974🔝
Call Girls in Shri Niwas Puri Delhi 💯Call Us 🔝9953056974🔝
 
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service ManualJohn Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
 
(COD) ̄Young Call Girls In Dwarka , New Delhi꧁❤ 7042364481❤꧂ Escorts Service i...
(COD) ̄Young Call Girls In Dwarka , New Delhi꧁❤ 7042364481❤꧂ Escorts Service i...(COD) ̄Young Call Girls In Dwarka , New Delhi꧁❤ 7042364481❤꧂ Escorts Service i...
(COD) ̄Young Call Girls In Dwarka , New Delhi꧁❤ 7042364481❤꧂ Escorts Service i...
 
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 person
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 personDelhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 person
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 person
 

06.CS2005-NetworkLayer-2021_22(1) (1).pptx

  • 1. CS2005 Networks and Operating Systems Network Layer J.F Kurose and K.W. Ross ©1996-2016
  • 2. Session objectives To understand: • The Network layer key functions • Forwarding / Routing • Routing algorithms • Internet Protocol (IPv4) • IPv4 datagram format • IPv4 datagram fragmentation • IPv4 addressing • Internet Protocol (IPv6) • Overview
  • 3. Network layer • Network layer protocol provides for logical communication between hosts. • The network layer can be decomposed into two interacting parts, the data plane and the control plane. • The data plane functions include per-router functions in the network layer that determine how a datagram arriving on one of a router’s input links is forwarded to one of that router’s output links. • The control plane functions include the network-wide logic that controls how a datagram is routed among routers along an end-to-end path from the source host to the destination host (using routing algorithms). • Traditionally, the control plane routing protocols and the data plane forwarding functions have been implemented together, monolithically, within a router. • Software-defined networking (SDN) explicitly separates the data plane and the control plane by implementing the control plane functions as a separate service, e.g. in a remote “controller.”
  • 4. Network layer (continued) • The network layer protocols run in every host and router. • On the sending side, the network layer takes segments from the transport layer, encapsulates each segment into a datagram, and then sends the datagrams to its nearby router. • On the receiving side, the network layer receives the datagrams from its nearby router, extracts the transport layer segments, and delivers the segments up to the transport layer.
  • 5. Two key network layer functions Forwarding • When a packet arrives at a router’s input link, the router must move the packet to the appropriate output link. • For example, a packet arriving from a host to the nearby router must be forwarded to the next router on a path. Forwarding is the most common and important one function in the data plane. Other functions include blocking packets from exiting a router (if, for example, the packet originated at a known malicious sending host, or is destined to a forbidden destination host) or duplicating packets and sent over multiple outgoing links. Routing • The network layer must determine the route or path taken by packets as they flow from a sender to a receiver. • The algorithms that calculate these paths are referred to as routing algorithms. • Routing is implemented in the control plane of the network layer.
  • 6. Forwarding and Routing • Forwarding refers to the router-local action of transferring a packet from an input link interface to the appropriate output link interface. Forwarding takes place at very short timescales (typically a few nanoseconds), and thus is typically implemented in hardware. • Routing refers to the network-wide process that determines the end-to-end paths that packets take from source to destination. Routing takes place on much longer timescales (typically seconds), and is often implemented in software. • A key element in every network router is its forwarding table. A router forwards a packet by examining the value of one or more fields in the arriving packet’s header, and then using these header values to index into its forwarding table. The value stored in the forwarding table entry for those values indicates the outgoing link interface at that router to which that packet is to be forwarded.
  • 7. So, how the router’s forwarding tables are configured? Traditional approach • The routing algorithm that determines the contents of the routers’ forwarding tables runs in each and every router and both forwarding and routing functions are contained within a router. • The routing algorithm function in one router communicates with the routing algorithm function in other routers to compute the values for its forwarding table. • How is this communication performed? • By exchanging routing messages containing routing information according to a routing protocol.
  • 8. So, how the router’s forwarding tables are configured? SDN approach • The routing algorithm that determines the contents of the routers’ forwarding tables runs in a physically separated remote controller that computes and distributes the forwarding tables to be used by each and every router. • The routing device performs forwarding only, while the remote controller computes and distributes forwarding tables. The remote controller might be implemented in a remote data centre with high reliability and redundancy, and might be managed by the ISP or some third party. • How might the routers and the remote controller communicate? • By exchanging messages containing forwarding tables and other pieces of routing information.
  • 9. Router architecture • A router consists of four router components. Input ports. An input port performs the physical layer function of terminating an incoming physical link at a router. • An input port also performs link layer functions needed to interoperate with the link layer at the other side of the incoming link. • It also performs a lookup function where the forwarding table is consulted to determine the router output port to which an arriving packet will be forwarded via the switching fabric. • Control packets (for example, packets carrying routing protocol information) are forwarded from an input port to the routing processor. • The number of ports supported by a router can range from a relatively small number in enterprise routers to hundreds of high speed ports in a router at an ISP’s edge.
  • 10. Router architecture (continued) Switching fabric. The switching fabric connects the router’s input ports to its output ports. This switching fabric is completely contained within the router. Output ports. An output port stores packets received from the switching fabric and transmits these packets on the outgoing link by performing the necessary link-layer and physical-layer functions. Routing processor. The routing processor performs control plane functions. • In traditional routers, it executes the routing protocols, maintains routing tables and attached link state information, and computes the forwarding table for the router. • In SDN routers, the routing processor is responsible for communicating with the remote controller in order to (among other activities) receive forwarding table entries computed by the remote controller, and install these entries in the router’s input ports. • The routing processor also performs the network management functions.
  • 11. Routing algorithms • The goal of a routing algorithm is to determine “good” paths (routes) from senders to receivers through the network of routers. A path is the sequence of routers packets will traverse in going from source to destination. A good path is the one that has the least cost (fastest, least congested, etc). graph: G = (N,E) – nodes and edges N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } cost of link c(w,z) = 5 cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp) Graph abstraction of a network • Routing algorithms can be classified as: • Centralised: all routers have the complete topology of a network (“link state” algorithms), or • Decentralised: a router knows only the physical connected neighbouring routers (“distance vector” algorithms). • Static: routes change very slowly over time. • Dynamic: change the routing paths as the network traffic loads or topology change. • Load-sensitive: link costs vary dynamically to reflect the current level of congestion in the underlying link. • Load insensitive: a link’s cost does not explicitly reflect its current (or recent past) level of congestion.
  • 12. IPv4 datagram format • There are two versions of the Internet Protocol, IPv4 and IPv6. • The key fields of the IPv4 datagram are: • Version number. A 4-bit number that specifies the IP protocol version of the datagram. IPv4 and IPv6 have datagram formats. By looking at the version number, the router can determine how to interpret the remainder of the IP datagram. • Header length. Because an IPv4 datagram can contain a variable number of options, the 4-bits header length is needed to determine where the payload begins. Most IP datagrams do not contain options, so the typical IP datagram has a 20-byte header. • Type of service. The 8-bit type of service (TOS) number allows to distinguish the different types of IP datagrams (e.g. real time / non-real time) and request services (e.g. priority, route for low-delay, high-throughput, etc.). • Datagram length. This is the total length of the IP datagram (header plus data), measured in bytes. Since this field is 16 bits long, the theoretical maximum size of the IP datagram is 65,535 bytes. However, datagrams are rarely larger than 1,500 bytes. • Identifier, flags, fragmentation offset. These three fields keep information needed for IP fragmentation. • Time-to-live. The time-to-live (TTL) field is included to ensure that datagrams do not circulate forever. TTL is decremented by one each time the datagram is processed by a router. If the TTL field reaches 0, a router must drop that datagram.
  • 13. IPv4 datagram format (continued) • Upper layer protocol. This field is typically used only when an IP datagram reaches its final destination. The value of this field indicates the specific transport-layer protocol to which the data portion of this IP datagram should be passed. For example, TCP is 6, UDP is 17 (see IANA Protocol Numbers https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). The protocol number is the link between the network layer and the transport layer. • Header checksum. It aids a router in detecting bit errors in a received IP datagram. Routers typically discard datagrams with detected errors. The checksum must be recomputed and stored again at each router, since the TTL field, and possibly the options field as well, will change. • Source and destination IP addresses. When a source creates a datagram, it inserts its IP address into the source IP address field and inserts the address of the ultimate destination into the destination IP address field. • Options. The options fields allow an IP header to be extended. Header options are not used frequently. The possible variable header length complicates the datagram processing in routers. • Data (payload). In most circumstances, the data field of the IP datagram contains the transport-layer segment (TCP or UDP) to be delivered to the destination. However, the data field can carry other types of data, such as ICMP messages. An IP datagram has a total of 20 bytes of header (assuming no options). If the datagram carries a TCP segment, then each (non-fragmented) datagram carries a total of 40 bytes of header (20 bytes of IP header plus 20 bytes of TCP header) along with the application-layer message.
  • 14. IPv4 datagram fragmentation • IP datagram is encapsulated within the link layer frame for transport from one router to the next router. • Not all link layer protocols can carry network layer packets of the same size. • The maximum amount of data that a link-layer frame can carry is called the maximum transmission unit (MTU). Therefore, the MTU limits the IP datagram size. • Each of the links along the route between source and destination can use different link layer protocols, and each of these protocols can have different MTUs. • So, how can a router transmit an IP datagram that cannot fit into the payload of the link layer frame? • IP fragments the payload in the IP datagram into smaller IP datagrams. These are encapsulated in separate link layer frames and these frames are sent over the outgoing link. Each of these smaller datagrams is called a fragment. • When a datagram is created, the sending host stamps the datagram with an identification number as well as source and destination addresses. • When a router needs to fragment a datagram, each resulting datagram (fragment) is stamped with the source address, destination address, and identification number of the original datagram. • When the destination receives a series of datagrams from the same sending host, it can examine the identification numbers of the datagrams to determine which of the datagrams are fragments of the same larger datagram.
  • 15. IPv4 datagram reassembly • Received fragments from the same sender and with same identification number belong to the same datagram. • IP is unreliable, so fragments of the same datagram may get lost or arrive our of order. So, in order the destination to be sure that it has received all fragments of the original datagram, the last fragment has the flag bit set to 0. • Apart from the last fragment, the destination needs to put the fragments in order and determine whether a fragment is missing. For this reason, the offset field is used to specify where the fragment fits within the original IP datagram. Example • A datagram of 4,000 bytes (20 bytes of IP header plus 3,980 bytes of IP payload) arrives at a router and must be forwarded to a link with an MTU of 1,500 bytes. • 3,980/1,500 = 2.65 so it can fit in 3 fragments. • 2 x (1,480 (payload) + 20 (header)) and 1 x (1,020 + 20). • Offset value for the first fragment is always 0. • Offset is specified in 8-byte blocks. • Offset value for the second fragment will be 0+ (1480 / 8). • Offset value for the third fragment will be 185 +(1480 / 8) . • Previous Offset + Previous Fragment Data transmitted/8).
  • 16. IPv4 addressing • Typically, a host has only a single link into the network. • Because a router’s job is to receive a datagram on one link and forward the datagram on some other link, a router necessarily has two or more links to which it is connected. • The boundary between the both the host and router and any one of their links is called an interface. • Because every host and router can send and receive IP datagrams, each host and router interface needs to have its own IP address. Thus, an IP address is technically associated with an interface rather than with the host or router containing that interface. • Each IP address is 32 bits long. There are in total of 2^32 (~4 billion) possible IP addresses. • IP addresses are written in dotted-decimal notation, in which each byte of the address is written in its decimal form and is separated by a period (dot). • For example, considering the IP address 193.32.216.9, the 193 is the decimal equivalent of the first 8 bits of the address, the 32 of the second 8 bits and so on. The binary notation is 11000001 00100000 11011000 00001001.
  • 17. IPv4 addressing (continued) • IP addresses cannot be chosen anyhow. • A portion of an interface’s IP address will be determined by the subnet to which it is connected. In IP terms, this network interconnecting many host interfaces and one router interface forms a subnet. • IP addressing assigns an address to a subnet, e.g. 223.1.1.0/24, where the /24 (“slash-24”) notation, sometimes known as a subnet mask, indicates that the leftmost 24 bits of the 32-bit quantity define the subnet address. • Let’s say that there are 2 hosts and a router connected to the above subnet with IP addresses 223.1.1.2, 223.1.1.5 and 223.1.4, respectively. • The 223.1.1.0/24 subnet therefore consists of the two host interfaces (223.1.1.2 and 223.1.1.5) and one router interface (223.1.1.4). • Any additional hosts attached to the 223.1.1.0/24 subnet would be required to have an address of the form 223.1.1.xxx. • Network classes: Class A subnet mask /8 - Class B subnet mask /16 and Class C subnet mask /24.
  • 18. IPv4 addressing (continued) • The Internet’s address assignment strategy is known as Classless Interdomain Routing (CIDR) [RFC 4632]. • The 32-bit IP address is divided into two parts and again has the dotted-decimal form a.b.c.d/x, where x indicates the number of bits in the first part of the address. • The x most significant bits of an address of the form a.b.c.d/x constitute the network portion of the IP address, and are often referred to as the prefix (or network prefix) of the address. • An organization is typically assigned a block of contiguous addresses, that is, a range of addresses with a common prefix
  • 19. IPv6 overview • Main motivation for IPv6 was the realisation that the 32-bit IPv4 address space was beginning to be used up. • The most important changes are: • Expanded addressing capabilities. IPv6 IP address are 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 fixed 40-byte header. As discussed below, a number of 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.
  • 20. Session objectives To understand: • The Network layer key functions • Forwarding / Routing • Forwarding and Routing: The Data and Control Planes • What’s Inside a Router? (Overview and Input Port Processing and Destination-Based Forwarding ONLY) • Routing algorithms • Routing Algorithms (Overview ONLY) • Internet Protocol (IPv4) • The Internet Protocol (IP): IPv4, Addressing, IPv6, and More (Overview, IPv4 Datagram Format, IPv4 Datagram Fragmentation, IPv4 Addressing ONLY) • Internet Protocol (IPv6) • IPv6 (Overview and IPv6 Datagram Format ONLY)