Chapter3 1 NetworkLayer
Chapter3 1 NetworkLayer
Chapter 3 part 1
• Design Issues
• Routing Algorithms
• Congestion Control
• Quality of Service
• Internetworking
• Network Layer of the Internet
The Network Layer
Application
Responsible for delivering packets
Transport
between endpoints over multiple
Network
links
Link
Network Layer is the lowest layer in Physical
the OSI Reference Model that deals
with end-to-end transmission.
It provides services to the Transport
Layer.
Design Issues
Questions: If P1 on Host H1 is sending a message to P2 on H2, for the packet at Host H1:
• What is the destination address for the packet’s network layer?
• What is the destination address for the packet’s data link layer?
Connectionless Service – Datagrams
Packet is forwarded using destination address inside it
• Different packets may take different paths
ISP’s equipment
A’s table (initially) A’s table (later) C’s Table E’s Table
Dest. Line
5
Connection-Oriented – Virtual Circuits
Packet is forwarded along a virtual circuit using tag inside it
• Virtual circuit (VC) is set up ahead of time
ISP’s equipment
Question: For the Internet Protocol Suite, is there ANY connection-oriented protocol
at the Network Layer whatsoever? 6
Comparison of Virtual-Circuits & Datagrams
8
Routing Algorithms (1)
Routing logically comprises two processes:
1. Forwarding: processing arriving packets by looking up
appropriate outgoing link to use from routing tables
2. Filling in and updating the routing tables. This is
where
routing algorithms occur.
• Optimality principle »
• Shortest path algorithm »
• Flooding »
• Distance vector routing »
• Link state routing » Routing Algorithms
• Hierarchical routing »
• Broadcast routing »
• Multicast routing »
• Anycast routing »
• Routing for mobile hosts »
• Routing in ad hoc networks »
Routing Algorithms (2)
Routing is the process of discovering network paths
• Model the network as a graph of nodes and links
• Decide what to optimize (e.g., fairness vs efficiency)
• Update routes for changes in topology (e.g., failures)
Fairness Example
where vertical Comms
saturate horizontal links.
10
The Optimality Principle
Each portion of a best path is also a best path; the union of
them to a router is a tree called the sink tree.
• Best means fewest hops in the example
B
Algorithm:
• Start with sink, set distance at other nodes to infinity
• Relax (i.e., evaluate) distance to adjacent nodes
• Pick the lowest adjacent distance node, add it to sink
tree
Shortest Path Algorithm (2) Labels =
(distance, path)
Start
at Sink
and compute
backwards
Relaxation step.
Lower distance to
nodes linked to
newest member of
the sink tree
...
Shortest Path Algorithm (4)
...
15
Flooding
Algorithm:
• Each node knows distance of links to its neighbors
• Each node advertises vector of lowest known
distances to all neighbors
• Each node uses received vectors to update
its own
Distance Vector Routing (2)
Network
New vector
for J
Vectors received at J from
Neighbors A, I, H and K
18
The Count-to-Infinity Problem
Distance Vector (DV) algorithm has a convergence issue in that it can
converge to a correct routing map slowly because it reacts rapidly to good
news but leisurely to bad news
Algorithm:
• Each node floods information about its neighbors in
LSPs (Link State Packets); all nodes learn the full
network graph with identical view of network
topology
• Each node runs Dijkstra’s algorithm to compute the
path to take from itself to each destination
Link State Routing (2) – LSPs
LSP (Link State Packet) for a node lists neighbors and
weights of links to reach them
Sender ID
Sequence #
Age
List
neighbor
and cost
One row of the database is used for each recently arrived but not as
yet fully processed LSP. 1 in Send flag indicates the link that info needs to
be sent on and 1 in ACK indicates where receipt of info needs to be ack to.
5. Next step is to have each node locally run the Dijkstra Algorithm on the
received info. Therefore, possible that different directions of same path might have different
Hierarchical Routing
Routing tables grow as networks grow which may cause issues. HR divides routers
into regions for 2-level hierarchies; 3-level or more possible.
• Kamoun and Kleinrock – optimal number of levels for N router network is ln N
Hierarchical routing reduces the work of route computation but
may result in slightly longer paths than flat routing
Best choice to
reach nodes in 5
except for 5C
23
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Tannenbaum’s Use of “Broadcast” at the
NW Layer
• Tannenbaum confusingly uses “broadcast” to describe how
routers support Multicast (MC).
• Broadcast is NOT a service available to the end user at the network
layer within the Internet protocol suite.
S S
p 1.
Sink tree from core to group 1 Multicast is send to the core then
down when it reaches the sink tree
Used by PIM-SM
27
Anycast Routing
Anycast can be used by services – packet sent to the nearest member of a
group (the group all use the same well-known IP address). E.g., DNS
Anycast sends a packet to one (nearest) group member
• Falls out of regular routing with a node in many places
− Distance vector will send packet to shortest path of that addr
− Link state distinguishes between routers and host. It also can resolve
anycast addr as long as Anycast nodes are in different parts of the
network from each other (e.g., in different network areas, ASes).
30
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall,
2011
Routing in Ad Hoc Networks
A’s starts to A’s broadcast B’s and D’s C’s, F’s and G’s
find route to reaches B & D broadcast broadcast
I reach C, F & G reach H & I
31
Congestion Control (1)
Congestion causes packet delay and loss that degrades performance.
End-to-End backpressure
Quality of Service
• Application requirements »
• Traffic shaping »
• Packet scheduling »
• Admission control »
• Integrated services »
• Differentiated services »
Application Requirements (1)
to send
to send
Using a Token Bucket algorithm; a-c shows traffic shaping results of different R and
B Token Bucket configs and d-f shows corresponding Token Bucket status
Smaller bucket size delays traffic and reduces burstiness
45
Packet Scheduling (1)
Packet scheduling provides a mechanism for net admins of an AS to
reserve resources for certain types of traffic (“flows”). Resources can be
bandwidth, buffer space, and/or CPU cycles.
2 2
3 3 3
Merge
52
Differentiated Services (1)
Design with classes of QoS (done on a router-by-router level though
configuring per hop behaviors (PHB) for DiffServ field of IP header);
customers buy what they want through “service level
agreements”
• Expedited class is sent in preference to regular class
− PHB given preferential treatment
• Less expedited traffic but better quality for applications
53
Differentiated Services (2)
Implementation of DiffServ:
• Classifier – e.g., Customers mark desired PHB class on DiffServ field
of IP packet
• Policer – Ingress router ensures the classification in line with service
level agreement (i.e., markings have been paid for)
• ISP shapes traffic (priority/drop/queueing configs) according to how it
implemented (configured) the PHP in its AS
− For example, Routers use WFQ to give different service levels
Packet mapped
to a VC here
Tunneling analogy:
• tunnel is a link; packet can only enter/exit at ends
Packet Fragmentation (1)
Links have different packet size limits for many reasons
• Large packets sent with fragmentation & reassembly
… destination
G1 fragments will reassemble
Original packet:
(10 data bytes)
Fragmented:
(to 8 data bytes)
Re-
fragmented:
(to 5 bytes)
Packet Fragmentation (3)
Fragmentation is detrimental to performance due to header overheads for
fragmented packets and the whole packet is lost if any fragments are
lost. This is why packets are not fragmented in IPv6 (but they can be in
IPv4). For IPv6, packets are dropped if they are larger than the MTU
(Max Transmission Unit). MTU is a function of routing path (i.e.,
underlying links). MTU discovery used to learn the MTU for that path.
• IP Version 4 »
• IP Addresses »
• IP Version 6 »
• Internet Control Protocols »
• Label Switching and MPLS »
• OSPF—An Interior Gateway Routing Protocol »
• BGP—The Exterior Gateway Routing Protocol »
• Internet Multicasting »
• Mobile IP »
Network Layer in the Internet (2)
IP has been shaped by guiding principles (e.g., RFC
1958):
− Make sure it works
− Keep it simple
− Make clear choices Question: Is the rationale
− for the entries on this list clear?
Exploit modularity
Please identify any item that
− Expect heterogeneity you don’t know why it is
− Avoid static options and important.
parameters
− Look for good design (not perfect)
− Strict sending, tolerant receiving
− Think about scalability
− Consider performance and cost
CS 450’s Second Writing Assignment contrasts bulleted list on pages 436-437
(summarized above) with Noel Chiappa’s Internet-Draft document used in the IPv6
creation process.
Network Layer in the Internet (3)
Internet is an interconnected collection of many networks
that is held together by the IP protocol
• In the IETF participants often distinguish between 3 distinct ISP roles
• Tier 1, Tier 2, Tier 3
65
IP Version 4 Protocol (1)
IPv4 (Internet Protocol) header is carried on all packets
and has fields for the key parts of the protocol:
Transmission must be big endian (left to right, high order bit
first)
Remember: IPv4 addresses are 32 bits; written as period denominated octets in decimal
IP Addresses (1) – Prefixes
Classless InterDomain Routing (CIDR) addresses (RFC 4632) have been
used from the mid-1990s on.
Addresses are allocated in blocks called prefixes
• Prefix is the network portion (routing topology
locator)
• Host – identifies a specific network interface within
that subnetwork
• Written: address/length, e.g., 18.0.31.0/24
/ is pronounced “slash”
ISP advertises
a single
prefix
ISP’s customers have prefixes with larger slash #s (thus fewer addresses)
Cambridge: 11000000.00011000.00000 plus 211 host addr Question: How many
Oxford: 11000000.00011000.0001 plus 212 host addr host addr are really
Edinburgh: 11000000.00011000.000010 plus 210 host addr in each subnetwork
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall,
in this example?
IP Addresses (4) – Longest Matching Prefix
Graph:
3
Broadcast LAN is
modeled as if it were a
well-connected node
(one designated router
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D.
IDed per LAN)
erall, 2011
Weth
OSPF— Interior Routing Protocol (2)
86
Internet Multicasting
88
End