Lecture 4 Network Layer I
Lecture 4 Network Layer I
Objectives
• Routing Algorithms
01/31/2024 1
The OSI Layers
01/31/2024 2
OSI … TCP/IP Layers
01/31/2024 3
Hosts, Routers, & Switches
01/31/2024 4
The Network Layer (OSI)
01/31/2024 5
OSI … TCP/IP Layers
• Data unit from application layer….STREAM
• Down to the next layer…..SEGMENT (Transport)
• Down to the next layer…..DATAGRAM (IP Layer)
• Down to the next layer….. FRAMES/PACKETS
01/31/2024 6
Datagram Format
01/31/2024 7
Datagram Fields …1
• VERS specifies the version of IP that created the datagram. IPv4
or IPv6
• HLEN specifies the number of 32-bit words that makes up the
header
• SERVICE TYPE specifies how the datagram should be handled –
low delay, high throughput, high reliability…see diagram below
PRECEDENCE bits(3) specify prioritization of datagrams (0 for
low, and 7 for high). The D bit when set is for low delay, the T bit is
for high throughput, and the R is for high reliability
01/31/2024 8
Datagram Fields …2
• TOTAL LENGTH specifies the length of the entire IP datagram
measured in octets (including the header and data); 16bits =
65,535 octets datagram size
• TIME TO LIVE (TTL) is set to specify the time, in seconds, the
datagram should be hopping around. At every router it is
decreased by 1. It is discarded at 0 and an error message is sent
to the sending station.
• PROTOCOL specifies which high-level protocol was used to
create the datagram (TCP=6 or UDP=17)
• CHECKSUM used for error detection of datagram headers
• SOURCE & DESTINATION IP ADDRESSES IP addresses of sending
and receiving sites
01/31/2024 9
Overview of NL
routing algorithm Two processes in router:
Forwarding: forward packets
local routing table according to routing table
header value output link
Routing: change and fill routing table
0100 3
0101 2 according to routing algorithms
0111 2
1001 1
value in arriving
packet’s header
0111 1
3 2
01/31/2024 10
Overview of the Network Layer
• Sending: transport layer sends SEGMENTS to receiving
host – Network/IP layer
01/31/2024 11
Packet Switching
• Store-and-Forward Packet Switching
Front View
01/31/2024 14
Linksys Router. Early model
01/31/2024 15
Routing
01/31/2024 16
Routing
Topics
01/31/2024 17
Wide Area Networks
01/31/2024 19
Early Switching Offices
01/31/2024 20
Generalized Network Topology
01/31/2024 23
Graph Abstraction
Graph: G = (N,E)
N = set of routers = { u, v, w, x, y, z }
Approaches:
Distributed: distance vector routing algorithm
Centralized: link state routing algorithm
01/31/2024 25
Graph Abstraction Costs
• c(x,x’)= cost of
link (x,x’)
- e.g., c(w,z) = 5
01/31/2024 26
Types of Routing
01/31/2024 27
Centralized Routing
This means that all interconnection information is
generated and maintained at one single location
01/31/2024 28
Routing Matrix
01/31/2024 29
Distributed Routing
In this routing, there is no central control.
01/31/2024 30
Static & Dynamic Routing
• Static routing means that once a node determines
its routing table, the node does not change it. The
assumption is that the conditions that led to the
table definition have not changed.
01/31/2024 31
Summary
Routin Type Advantages Disadvantages
Distributed Failure of a node or link has little Takes longer for a node to learn of
impact on providing routing info conditions in remote locations
01/31/2024 32
Distant Vector Algorithm (1)
Then
01/31/2024 36
Dijkstra’s Algorithm (2)
link costs known to all nodes Notation:
accomplished via “link c(x,y): link cost from node x to
state broadcast” y; = ∞ if not direct neighbors
all nodes have same info D(v): current value of cost of
computes least cost paths path from source to dest. v
from one node (‘source”) to p(v): predecessor node along
all other nodes path from source to v
gives routing table for that N': set of nodes whose least cost
node path definitively known
iterative: after k iterations,
know least cost path to k
dest.’s
01/31/2024 37
The End
01/31/2024 38