0% found this document useful (0 votes)
56 views163 pages

Module-3 PPT

This document discusses routing algorithms at the network layer. It covers several types of routing algorithms including flooding, distance vector routing, and link state routing. Flooding involves sending every packet on every link except the incoming link. Distance vector routing uses each router's vector table to choose the best path based on information exchanged periodically with neighbors. Link state routing improves on distance vector routing by taking line bandwidth into account when selecting routes.

Uploaded by

vinutha k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views163 pages

Module-3 PPT

This document discusses routing algorithms at the network layer. It covers several types of routing algorithms including flooding, distance vector routing, and link state routing. Flooding involves sending every packet on every link except the incoming link. Distance vector routing uses each router's vector table to choose the best path based on information exchanged periodically with neighbors. Link state routing improves on distance vector routing by taking line bandwidth into account when selecting routes.

Uploaded by

vinutha k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 163

CHAPTER 5

THE NETWORK LAYER


I. Network Layer Design Issues
II. Routing Algorithm
III.Congestion Control Algorithms
IV. QOS Control Algorithms
V. Internetworking
VI.The Network Layer in the Internet
NETWORK LAYER DESIGN ISUES
1. Store-and-Forward Packet
Switching
2. Services Provided to the Transport
Layer
3. Implementation of Connectionless
Service
4. Implementation of Connection-
Oriented Service
5. Comparison of Virtual-Circuit and
Datagram Subnets
Network Layer Design Issues:
Store-and-forward packet switching

A host with a packet to send transmits it to the nearest


router.
The packet is received, verified, and stored.
Then it is forwarded to the next router.
This step can be repeated many times.
Finally the packet reaches the destination host.
Network Layer Design Issues:
Services provided to the transport layer
• The network layer services should been designed with the
following goals in mind.
– The services should be independent of the router
technology.
– The transport layer should be shielded from the number,
type, and topology of the routers present.
– The network addresses made available to the transport
layer should use a uniform numbering plan, even
cross LANs and WANs.
• Two types of network layer services:
– Connection-oriented service vs connected-less service
Network Layer Design Issues:
Services provided to the transport layer

• Two-type of services:
– Connection-less services :
• 40+ years of experience with the computer
network, unreliable internet, hosts doing error
control and flow control.
– Connection-oriented services:
• 100+ years of experience with the worldwide
telephone system, quality of service.
 Connection-less + connection-oriented
services.
Network Layer Design Issues:
Services provided to the transport layer
• Implementation of connectionless services
– No advance setup is needed.
– Packets are injected into the subnet individually and
routed independently of each other.
– The packets are frequently called datagrams (in analogy
with telegrams) and the subnet is called a datagram
subnet.
• Implementation of connection-oriented services
– A path from the source router to the destination router
must be established before any data packets can be sent.
– This connection is called a VC (virtual circuit), similar to
physical circuits set up by the telephone system,
– The subnet is called a virtual-circuit subnet.
Network Layer Design Issues:
Implementation of Connectionless Service
Network Layer Design Issues:
Implementation of Connectionless Service
P1 on H1  P2 on H2
• P1:application layer  H1: transport layer
• H1:transport layer  H1: network layer
(disassemble)

• H1:network layer  H2: network layer


– The routes for packets 1,2,3
H1  A  C  E  F 
H2
– The routes for packets 4
 A  layer
• H2:H1network BD EH2: Ftransport layer (assemble)
 H2
• H2: transport layer  P2: application layer
Network Layer Design Issues:
Implementation of Connection-Oriented Service

Routing within a virtual-circuit subnet


Network Layer Design Issues:
Comparison of Virtual-Circuit and Datagram Subnets
ROUTING ALGORITHMS

1. The Optimality Principle


2. Shortest Path Routing
3. Flooding
4. Distance Vector Routing
5. Link State Routing
6. Hierarchical Routing
7. Broadcast Routing
8. Multicast Routing
9. Anycast Routing
10. Routing for Mobile Hosts
11. Routing in Ad Hoc Networks
Routing Algorithms:
Introduction
• The main function of the network layer is to route
packets from the source machine to the destination
machine.
• The routing algorithm is used to decide which output
line an incoming packet should be transmitted on
– For datagram networks, this decision must be
made a new for every arriving data packet since
the best route may have changed since last time.
– For virtual-circuit networks, this decision is made
only when a new virtual circuit is being set up.
Thereafter, data packets just follow the previously
established route.
Routing Algorithms:
• A routerIntroduction
performs two tasks:
– To forward the incoming packet according to the routing
table (Forwarding)
– To fill in and update the routing table (Routing)
• Desirable properties in a routing algorithm:
– Correctness , simplicity : no comment
– Robustness : The routing algorithm should cope with
changes in the topology and traffic without requiring all
processes in all hosts to be aborted and the network to be
rebooted every time some router crashes.
– Stability: A stable algorithm reaches equilibrium and
stays there.
– Fairness , Efficiency : Conflict between fairness and
efficiency.
Routing Algorithms:
Introduction

Conflict between fairness and efficiency.


Routing Algorithms:
• ClassesIntroduction
of routing algorithms
– Nonadaptive algorithms do not base their routing
decisions on measurements or estimates of the current
traffic and topology. Instead, the choice of the route to
use to get from I to J (for all I . and J) is computed in
advance, off-line, and downloaded to the routers when
the network is booted.
– Adaptive algorithms in contrast, change their
routing decisions to reflect changes in the topology,
and usually the traffic as well. They differ in
• where they get their information,
• when they change the routes, and
• what metric is used for optimization.
Routing Algorithms: The optimality
principle principle: If router J is on the optimal path
• Optimality
from router I to router K (IJK), then
the optimal path from J to K also falls along the same
route.
• Sink tree : The set of optimal routes from all sources
to a given destination form a tree rooted at the
destination. (a) A subnet. (b) A sink tree for router B.
Routing Algorithms: Shortest path
• Torouting
build a graph of the subnet,
– with each graph node representing a router and
– each graph edge representing a
communication line.
• To choose a route between a given pair of routers, the
algorithm just finds the shortest path between them.
• How to measure path length:
– Hops , Physical distance Bandwidth , traffic ,
cost , measured delay , mean queue length and
– Other factors or combinations of these factors.
Routing Algorithms: Shortest path
• Userouting
Dijkstra's algorithm to compute the shortest path.
– Each node is labeled with its distance from the source
node along the best known path.
– Initially, no paths are known, so all nodes are
temporarily labeled with infinity.
– As the algorithm proceeds and paths are found, the
labels may change, reflecting better paths. A label
may be either temporary or permanent.
– When it is discovered that a label represents the
shortest possible path from the source to that node, it
is made permanent and never changed thereafter.
Routing Algorithms: Shortest path
routing
Routing Algorithms: Shortest path
routing
Routing Algorithms: Shortest path
routing
Routing Algorithms:
Flooding
• Flooding: Every incoming packet is sent out on every
outgoing line except the one it arrived on.
• How to damp the flooding process:
– One is to have a hop counter contained in the header
of each packet, which is decremented at each hop.
– The other is to keep track of which packets have been
flooded, to avoid sending them out a second time.
• A variation of flooding that is slightly more practical
is selective flooding.
• Flooding is not practical in most applications, but it
does have some uses such as military
applications.
Routing Algorithms: Distance vector routing
• Distance vector routing Bellman-Fordrouting):
– Each router maintains a vector or table giving
• the best known distance to each destination
and
• which line to use to get there.
– These tables are updated by exchanging information
with the neighbors. To update these tables
• Measure its distance to its neighbors
• Receive the vectors from its neighbors
• Compute its own new vector.
Routing Algorithms: Distance vector routing
• Assume that
– delay is used as a metric and that the router knows the delay
to each of its neighbors.
– Once every Tmsec, each router sends to each neighbor a list
of its estimated delays to each destination. It also receives a
similar list from each neighbor.
• Imagine
– one of these tables has just come in from neighbor X,
with Xi being’s estimate of how long it takes to get to router
i.
– If the router knows that the delay to X is m msec,
– Then it can reach router i via X in Xi + m msec.
• By performing this calculation for each neighbor, a router can
find out which estimate seems the best and use that estimate
and the corresponding link in its new routing table.
• Note that the old routing table is not used in the calculation.
Routing Algorithms: Distance vector routing
(a) A
subnet.
(b) Input
from
A, I,
H, K,
and the
new
routing
table
for J.
Routing Algorithms: Distance vector routing
The count-to-infinity problem : It reacts
rapidly to good news,
but leisurely to bad news.
Routing Algorithms: Link state routing
• Problems with distance vector routing
– The delay metric was queue length, thus it did not
take line bandwidth into account when choosing
routes.
– The algorithm often took too long to converge.
•  Link state routing: Each router must do the
following:
1. Discover its neighbors, learn their network
address.
2. Set the distance or cost metric to each of its
neighbors.
3. Construct a packet containing all it has just
learned.
4. Send this packet to and receive packets from all other
Routing Algorithms: Link state routing
• Step 1: Learning about the neighbors
– One router sends a special HELLO packet on
each point-to-point line.
– The router on the other end is expected to send
back a reply telling who it is.
– These names must be globally unique.
–  The info about the neighbors can be found
out.
Routing Algorithms: Link state routing
Designated Router and
Backup Designated Router
(a) Nine routers and a LAN.
(b) A graph model of (a)
Routing Algorithms: Link state routing
• Step 2: Measuring line cost
– To determine the delay is to send over the line a
special ECHO packet that the other side is
required to send back immediately.
– By measuring the round-trip time and dividing it
by 2, the sending router can get a reasonable
estimate of the delay.
– Average delay value can be better.
Routing Algorithms: Link state routing
• Steps 3: Building link state packets
– Each router builds a packet containing all the data.
– The packet starts with the identity of the sender,
followed by a sequence number and age and a list of
neighbors.
– To build them is easy, but when to build
them is difficult to determine:
• To build them periodically (at regular
intervals)
• To build them when some significant event occurs,
such as a line or neighbor going down or coming
back up again or changing its properties appreciably.
Routing Algorithms: Link state routing

(a) A subnet.
(b) The link state packets for this subnet.
Routing Algorithms: Link state routing
• Steps 4: Distributing the link state packets
– To use flooding to distribute the link state packets
– To keep track of all the (source router, sequence)
pairs they see.
– To include the age of each packet after the
sequence number and decrement it once per
second.
Routing Algorithms: Link state routing
• Steps 5: Computing the new routes
– Once a router has accumulated a full set of link state
packets, it can construct the entire subnet graph
because every link is represented.
– Dijkstra’s algorithm can be run locally to construct the
shortest path to all possible destinations. The results
of this algorithm can be installed in the routing tables.
– Some applications
• IS-IS (Intermediate System – Intermediate System)
• OSPF (Open Shortest Path First)
Routing Algorithms: Hierarchical routing
• As networks grow in size, the router routing tables
grow proportional, and so do router memory and
computing power.
• Two level routing: Every router knows
– all the details about how to route packets to
destinations within its own region
– but knows nothing about the internal structure of other
regions.
• Multiple-level routing:
– Regions  clusters zones groups …
Routing Algorithms: Hierarchical routing
Reduction of routing tables
Routing Algorithms: Hierarchical routing
• How many levels should the hierarchy have?
– Consider a subnet with 720 routers
• No hierarchy: every router needs 720 routing table
entries.
• 30 routers/region x 24 regions : every
router needs 30 for local entries + 23 for other
regions = 53 table entries.
• 10 routers/region x 9 regions/cluster x 8 clusters :
every router needs 10 + 8 + 7 = 25 table entries.
– Kamount and Kleinrock (1979): The optimal
number of levels for an N router subnet is lnN,
requiring a total of e ln N entries per router.
Routing Algorithms: Broadcast
• routing to send a packet to all destinations
Broadcasting:
simultaneously.
– The source simply sends a distinct packet to every
destination.
– Flooding.
– Multidestination routing (each packet contains either
a list of destinations or a bit map indicating the
desired destinations.) (One router pays full fare and
the rest ride free.)
– To make use of the sink tree for the router initiating
the broadcast.
– Reverse path forwarding.
Routing Algorithms: Broadcast
–routing
Reverse path forwarding:
• When a broadcast packet arrives at a router, the
router checks to see if the packet arrived on the
line that is normally used for sending packets to
the source of the packets.
• If so, there is an excellent chance that the
broadcast packet itself followed the best route
from the router and is therefore the first copy to
arrive at the router. Then the router forwards
copies of it onto all lines except the one it arrived
on.
• If no, it is discarded as a duplicate.
Routing Algorithms: Broadcast
routing
Reverse path forwarding.
(a) A subnet.
(b) a Sink tree.
(c) The tree built by reverse path forwarding.
Routing Algorithms: Multicast routing
• Multicasting : to send messages to well-defined groups that
are numerically large in size but small compared to the
network as whole.
– Group management: Some way is needed to create and
destroy groups, and to allow processes to join and
leave groups.
– Computing a spanning tree covering all other routers.
– Multicast routing is to prune the spanning tree.
• When a process sends a multicast packet to a group,
• The first router examines its spanning tree
• and prunes it, removing all the lines that do not lead
to hosts that are members of the group.
Routing Algorithms: Multicast routing
(a) A network. (b) A spanning tree for the leftmost
router.
(c) A multicast tree for group 1.
(d) A multicast tree for group 2.
Routing Algorithms: Multicast routing
(a)Core-based tree for group 1.
(b)Sending to group 1.
Routing Algorithms: Anycast
• routinga packet is delivered to the nearest member
In anycast,
of a group. Schemes that find these paths are called
anycast routing.
Routing Algorithms: Routing the mobile
hosts
Routing
Routing inAlgorithms
Ad Hoc Networks:
: Route discovery
(a) Range of A's broadcast.
(b) After B and D have received A's broadcast.
(c) After C, F, and G have received A's broadcast.
(d) After E, H, and I have received A's broadcast.
Shaded nodes are new recipients. Arrows show
possible reverse routes.
Congestion Control
Algorithms: Approaches to
• Congestion
Time scales ofControl
approaches to congestion control
– Network provisioning : months
– Traffic-aware routing: hours
– Admission control: minutes
– Traffic throttling: seconds
– Load shedding: seconds
Congestion Control
Algorithms: Traffic-Aware
Routing
A subnet in which the East and West parts
are connected by two lines.
Congestion Control
Admission control
Algorithms:
• Traffic is often described in terms of its rate and
shape.
• A commonly used descriptor that captures this effect
is the leaky bucket or token bucket.
• Armed with traffic descriptions, the network can
decide whether to admit the new virtual circuit.
Congestion Control
Admission control
Algorithms:
(a) A congested subnet. (b) A redrawn subnet,
eliminates congestion and a virtual circuit from
A to B.
Congestion Control
Traffic
Algorithms : Throttling
• In the Internet and many other computer networks,
senders adjust their transmissions to send as much
traffic as the network can readily deliver.
1. Routers must determine when congestion is
approaching, ideally before it has arrived.
2. Routers must deliver timely feedback to the senders
that are causing the congestion.
Congestion Control
Traffic Throttling
Algorithms:
• Each router monitors the utilization of its output
lines and other resources.
• Router uses the technique Estimate of the queuing
delay by using Exponentially weighted moving
average(EWMA)
• Whenever d moves above the threshold, the output
lines enters a “warning stat”.

d : Estimate of the Queuing delay


s : a sample of the instantaneous queue length
a : determines how fast the router forgets recent history

• Possible actions:
– Choke packets
– Explicit Congestion Notification
– Hop-by-Hop Backpressure
Congestion Control
Traffic Throttling
Algorithms:
Choke packets
• If congestion occurs, the router sends a choke packet
back to the source host,
• When the source gets the choke packet, it reduces the
traffic sent to the specified destination by X percent.
And the source will ignore other choke packets referred
to that destination for a fixed time interval. ……
• Types of choke packets:
– a mild warning,
– a stern warning,
– an ultimatum
Congestion Control
Congestion Control in Datagram Subnets
Algorithms:
Explicit Congestion Notification
• Two bits in the IP packet header are used to record
whether the packet has experienced congestion.
• If any of the routers they pass through is congested,
that router will then mark the packet as having
experienced congestion as it is forwarded.
• The destination will then echo any marks back to the
sender as an explicit congestion signal
Congestion Control
Congestion Control in Datagram Subnets
Algorithms:
Hop-by-hop choke packets
• At high speeds or over long distances, sending a choke
packet to the source hosts does not work well because
the reaction is so slow.
– For example, a host in San Francisco (router A) sends
packets to a host in New York at 155Mbps.
– When the New York host begins to run out of buffers, it will
take about 40msec for a choke packet to get back to San
Francisco to tell it to slow down.
– In those 40 msec, another 6.2 megabits will have been sent.
• To have the choke packet take effect at every hop it
passes through.
Congestion Control in
Datagram Subnets

• Hop-by-Hop Choke
Packets
(a) A choke packet
that affects only
the source.
(b) A choke packet
that affects each
hop it passes
through.
Congestion Control Algorithms: Load shedding
• Load shedding is a fancy way of saying when routers
are being drowned by packets that they cannot
handle, they just throw them away. (Electricity)
• Which packets to drop?
– At random
– Application: To drink wine (old is better than new) or
milk (new is better than old)?
– Compression: full frame or modification?
– Priority: High or low? (Unless there is some
significant incentive to mark packets as anything
other than VERY IMPORTANT – NEVER NEVER
DISCARD, nobody will do it.
Congestion Control Algorithms: Load shedding
• RED (Random Early Detection)
– Why early?
• Dealing with congestion after it is first detected is
more effective than letting it gum up the works
and then trying to deal with it.
• Try to discard packets before all the buffer space
is really exhausted.
– Why random?
• Since the router probably cannot tell which source
is causing most of the trouble, picking a packet at
random from the queue that triggered the action
is probably as good as it can do.
QUALITY OF SERVICE

• Requirements of QoS
• Techniques for QoS
• Integrated Services
• Differentiated Services
• Label Switching and MPLS
Quality Of Service: Requirements
• A flow is a stream of packets from a source to a
destination.
– In a connection-oriented network, all the packets
belonging to a flow follow the same route;
– In a connection-less network, they may
follow different routes.
• The needs of each flow can be characterized by four
primary parameters:
– Reliability,
– Delay ,
– Jitter ,
– Bandwidth .
Quality Of Service: Requirements

How stringent the quality-of-service requirements are.


Quality Of Service: Traffic shaping
(a) Shaping packets. (b) A leaky bucket. (c) A token
bucket
Quality Of Service: Traffic shaping
(a) Traffic from a host.

Output shaped by a token


bucket of rate 200 Mbps and
capacity
(b) 9600 KB,
(c) 0 KB.
Quality Of Service: Traffic shaping
Token bucket level for
shaping with rate 200
Mbps and capacity
(d) 16000 KB,
(e) 9600 KB, and
(f) 0KB..
Quality Of Service: Packet Scheduling
• Resource reservation
– Suppose there is a specific route for a flow, it
becomes possible to reserve resources along the route
to make sure the needed capacity is available.
• What resources to reserve?
– Bandwidth
– Buffer space
– CPU cycles
Quality Of Service: Packet Scheduling

Round-robin Fair Queuing


Quality Of Service: Packet Scheduling
(a)Weighted Fair Queueing.
(b)Finishing times for the packets.
Quality Of Service: Admission Control

An example flow specification


Quality Of Service: Admission Control
Bandwidth and delay guarantees with token buckets and
WFQ.
Quality Of Service: Integrated services
• How to stream multimedia?
– Integrated services (Flow-based algorithms)
– Differential services (Class-based algorithms)
• How about having the senders reserve bandwidth in
advance? Too many destinations
• RSVP (Resource reSerVation Protocol): to allow
multiple senders to transmit to multiple groups of
receivers, permits individual receivers to switch
channels freely, and optimizes bandwidth use while at
the same time eliminating congestion.
Quality Of Service: Integrated services

(a) A network, (b) The multicast spanning tree for host


1.
(c) The multicast spanning tree for host 2.
Quality Of Service: Integrated services

(a) Host 3 requests a channel to host 1. (b) Host 3 then requests a


second channel, to host 2. (c) Host 5 requests a channel to
host 1.
Quality Of Service: Differential services

Expedited packets experience a traffic-free


network. (RFC 3246)
Quality Of Service: Differential services

• Assured Forwarding (RFC2597)


Quality Of Service:
Label switching and MPLS

Transmitting a TCP segment using IP, MPLS, and PPP.


INTERNETWORKING
• How Networks Differ
• How Networks Can Be Connected
• Tunneling
• Internetwork Routing
• Packet Fragmentation
Internetworking: Introduction
• A variety of different networks (and thus protocols)
will be around
– The installed base of different networks is large and
growing.
– As computers and networks get cheaper, the place
where decisions get made moves downward.
– Different networks have radically different
technology, so it should not be surprising that as new
hardware developments occur, new software will be
created to fit the new hardware.
Internetworking: Introduction

A collection of interconnected
networks.
Internetworking: Introduction
• The interconnection of different networks
– LAN-LAN: A computer scientist downloading a
file to engineering.
– LAN-WAN: A computer scientist sending mail to
a distant physicist.
– WAN-WAN: Two poets exchanging sonnets.
– LAN-WAN-LAN: Engineers at different universities
communicating.
Internetworking: How Networks Differ
Some of the many ways networks can
differ
Internetworking: How Networks Can Be Connected

(a) Which device is in which layer.


(b) Frames, packets, and headers.
Internetworking:
How Networks Can Be Connected
(a)A packet crossing different networks.
(b)Network and link layer protocol processing.
Internetworking: Tunneling

Tunneling a packet from Paris to London.


Internetworking: Tunneling

Tunneling a car from France to England.


Internetworking: Internetwork Routing

(a) An internetwork.
(b) A graph of the
internetwork.
Internetworking: Internetwork Routing
• Two-level routing
– Internet routing: Exterior gateway protocol
– Intranet routing: Interior gateway protocol
• To route a packet
– A typical internet packet starts out on its LAN addressed
to the local multiprotocol router.
– After it gets there, the network layer code decides which
multiprotocol router to forward the packet to, using its own
routing tables.
• Direct forwarding using native network protocol
• Tunneling using the intervening network protocol
– This process repeats until the packet reaches the
desination network.
Internetworking: Fragmentation
• Each network imposes some maximum size on its
packets. These limits have various causes, among them:
– Hardware (e.g., the width of a TDM transmission
slot).
– Operating system (e.g., all buffers are 512 bytes).
– Protocols (e.g., the number of bits in the packet
length field).
– Compliance with some (inter)national
standard.
– Desire to reduce error induced retransmissions to
some level.
– Desire to prevent one packet from occupying the
channel too long.
Internetworking: Fragmentation
(a) Transparent fragmentation.
(ATM)
(b) Nontransparent fragmentation. (IP)
Internetworking: Fragmentation
• When a packet is fragmented, the fragments must be
numbered in such a way that the original data
stream can be reconstructed.
– To define an elementary fragment size small enough that the
elementary fragment can pass through every network.
– When a packet is fragmented, all the pieces are multiple of
the elementary fragment size.
– The internet header provide
• an original packet number and
• the number of the (first) elementary fragment contained
in the packet and
• a bit indicating the last piece of the original packet.
Internetworking: Fragmentation
Fragmentation when the elementary data size is 1 byte.
Internetworking: Fragmentation
Path MTU Discovery
THE NETWORK LAYER
IN THE INTERNET
• The IPv4 Protocol
• IP Addresses
• The IPv6 Protocol
• Internet Control Protocols
• OSPF – The Interior Gateway Routing Protocol
• BGP – The Exterior Gateway Routing
Protocol
• Internet Multicasting
• Mobile IP
The Network Layer in the Internet:
Top 10 principles for the Internet
1. Make sure it works.
2. Keep it simple.
3. Make clear choices.
4. Exploit modularity.
5. Expect heterogeneity.
The Network Layer in the Internet:
Top 10 principles for the Internet
6. Avoid static options and parameters.
7. Look for a good design; it need not be perfect.
8. Be strict when sending and tolerant when receiving.
9. Think about scalability.
10. Consider performance and cost.
The Network Layer in the Internet:
The Internet: Collections of Subnetworks or
ASes
The Network Layer in the Internet:
The IPv4 Protocol
An IP datagram consists of a header part and a text
part. The IPv4 (Internet Protocol) header.
The Network Layer in the Internet:
The IPv4 Protocol:
Header fields
• Version: to keep track of which version of the protocol the
datagram belongs to.
• IHL: to tell how long the header is, in 32-bit words. 5 <=
IHL
<= 15.
• Differentiated service:
– Type of service: 3 for priority, 3 for D, T, and R, and 2
unused.
– Differentiated services: 6 for service class, 2 for
congestion.
• Total length: the length of header and data. The maximum
length is 65,535 bytes.
• Identification: the ID of the datagram.
The Network Layer in the Internet:
The IPv4 Protocol:
Header fields
• DF: Don't Fragment (>= 576)
• MF: More Fragment (13?)
• Fragment offset: to tell where in the current datagram
this fragment belongs
• Time to Live: a counter used to limit packet lifetimes.
• Protocol: which transport process to give this datagram to.
(http://www.iana.org/assignments/protocol-numbers)
• Header checksum: to verify the header only
• Source and destination address: to indicate the network
number and host number.
• Options
The Network Layer in the Internet:
IP Header Options

Some of the IP
options.
The Network Layer in the Internet:
IP Addresses
• Every Internet interface has an IP address, which
encodes its network number and host number. The
combination is unique: no two interfaces have the same
IP address.
• All IP addresses are 32 bits long and are used in the
source address and Destination address fields of IP
packets
• IP addressing
– Prefixes
– Subnets (division),
– CIDR(mergement),
– Classful and Special Addressing
– NAT
The Network Layer in the Internet:
IP Addresses: Prefixes

An IP prefix.
The Network Layer in the Internet:
IP Addresses: Prefixes
Splitting an IP prefix into separate networks with
subnetting.
The Network Layer in the Internet:
IP Addresses:
CIDR
A set of IP address assignments
The Network Layer in the Internet:
IP Addresses:
CIDR
Aggregation of IP prefixes
The Network Layer in the Internet:
IP Addresses: CIDR
Longest matching prefix routing at the New York
router.
The Network Layer in the Internet:
IP Addresses: Classful and Special
Addressing
IP address formats
The Network Layer in the Internet:
IP Addresses: Classful and Special
Addressing

Special IP addresses
The Network Layer in the Internet:
IP Addresses: NAT(Network Address Translation)
• Addressing
– Permanent addresses: too few
– Temporary addresses (DHCP): large users
• Direct addressing (1-level)  indirect addressing (two-
level)
• NAT (Network Address Translation)
– To assign each company a single IP address (or at
most, a small number of them) for Internet
traffic
– Within the company, every computer gets a unique IP
address (10.x.x.x, 172.16.x.x, 192.168.x.x)
The Network Layer in the Internet:
IP Addresses: NAT

Placement and operation of a NAT box.


The Network Layer in the Internet:
IP Addresses: NAT
• How NAT works internally
– (IP add_src, port_src)  (IP add_dst,
port_dst)
– For outgoing5544)
• (10.0.0.1, packets  (198.60.42.12, 3344)
• (198.60.42.12, 3344)  (210.32.32.32, 4433)

• (198.60.42.12, 3344)  (210.32.32.32, 4433)


• (10.0.0.1, 5544)  (198.60.42.12, 3344)
The Network Layer in the Internet: IPv6
Major goals for IPV6
• Support billions of hosts.
• Reduce the size of the routing tables.
• Simplify the protocol, to allow routers to process
packets faster.
• Provide better security (authentication and
privacy).
• Pay more attention to type of service.
• Aid multicasting by allowing scopes to be
specified.
• Make it possible for a host to roam without changing its
address.
• Allow the protocol to evolve in the future.
The Network Layer in the Internet: IPv6
• In 1990, IETF started work on a new version of IP.
• IETF issued a call for proposals and discussion in RFC
1550(IP: Next Generation (IPng) White Paper
Solicitation).
• 21 in 1990  7 in 1992  3 in 1993  1
• IPv6 meets the goals fairly well.
– IPv6 has longer addresses than IPv4. They are
16 bytes long.
– The simplification of the header.
– Better support for options.
– Security
– More attention has been paid to type of service than
in the past.
The Network Layer in the Internet: IPv6
The IPv6 fixed header (required).
The Network Layer in the Internet: IPv6

IPv6 extension headers.


The Network Layer in the Internet: IPv6

The hop-by-hop extension header for large


datagrams (jumbograms).
The Network Layer in the Internet: IPv6
IPv6 extension headers.
The Network Layer in the Internet: IPv6
Controversies
• Address length: 8 byte, 16 byte, 20 bytes  16bytes
• Hop limit: 8 bits or more  8 bits
• Maximum packet size: 64 KB or larger  normal 64kB
and permit jumbograms.
• Checksum: needed or not  not needed any more.
• Mobile support: yes or no no but.
• Security: yes or no  no but.

• Huitema, C. 1998. “IPv6: The New Internet Protocol”


Prentice-Hall.
The Network Layer in the Internet:
Internet Control Protocols: ICMP

The principal ICMP message types.


The Network Layer in the Internet:
Internet Control Protocols: ARP
Two switched Ethernet LANs joined by a router
The Network Layer in the Internet:
Internet Control Protocols: ARP
How does a user on host 1 send a packet to a user on host 2?
• Find the IP address for host 2 (e.g. DNS)
• Build a packet with 192.31.65.5 in the Destination address
field
• Find the destination's Ethernet address: Conf File or ARP
• Build an Ethernet frame addressed to E2 and dump it into
the Ethernet.
• The Ethernet board of host 2 detects this frame, recognizes
it as a frame for itself, and causes an interrupt.
• The Ethernet driver extracts the IP packet from the
payload and passes it to the IP software.
The Network Layer in the Internet:
Internet Control Protocols: ARP
How host 1 sends a packet to host 4 (192.31.63.8).
• Host 1 packets the IP packet and sends the frame to E3.
• When the CS router gets the Ethernet frame, it finds the
physical address E3 by ARP. It then inserts the packet
into the payload field of a frame addressed to E6 and
puts it on the net.
• When the Ethernet frame arrives at host 4, the packet is
extracted from the frame and passed to the IP software
for processing.
The Network Layer in the Internet:
Internet Control Protocols: DHCP

• ARP (Address Resolution Protocol,


• RARP (Reverse Address Resolution Protocol) :
Given a Link address, what is the corresponding IP
address?
• BOOTP (Bootstrap Protocol) is better than RARP, can
be forwarded by a router.
• DHCP (Dynamic Host Configuration Protocol) allows
both manual IP address assignment and automatic
assignment.
The Network Layer in the Internet:
Internet Control Protocols: DHCP

Operation of DHCP.
The Network Layer in the Internet:
Label Switching and MPLS
Transmitting a TCP segment
using IP, MPLS, and PPP
The Network Layer in the Internet:
Label Switching and MPLS

Forwarding an IP packet
through an MPLS network
The Network Layer in the Internet:
OSPF – An Interior Gateway Routing Protocol
• The internet is made up of a large number of
autonomous systems.
• A routing algorithm within an AS is called an
interior gateway protocol
– Distance vector protocol (Routing Information
Protocol)
– Link state protocol (1979)
– OSPF (Open Shortest Path First in 1990)
• A routing algorithm between ASes is called an
exterior gateway protocol
– BGP (Border Gateway Protocol)
The Network Layer in the Internet:
OSPF
Requirements for the new routing algorithms:
1. To be open, hence the "O" in OSPF.
2. To support a variety of distance metrics.
3. To be a dynamic algorithm.
4. To support routing based on type of service.
5. To do load balancing
6. To support hierarchical systems.
7. To support security
8. To support connection to the Internet via a tunnel
The Network Layer in the Internet:
OSPF
An autonomous system
The Network Layer in the Internet:
OSPF
A graph representation of the previous slide.
The Network Layer in the Internet:
OSPF
The relation between ASes, backbones, and areas in
OSPF.
The Network Layer in the Internet:
OSPF
How a OSPF router works?
• When a router boots, it sends HELLO messages. From
the response, each router learns who its neighbors
are.
• Adjacent routers exchange information.
– Each router periodically floods LINK STATE
UPDATE messages to each of its adjacent routers.
These must be acknowledged (LINK STATE
ACK).
– Either partner can request link state information from
the other one using LINK STATE REQUEST
messages.
– Each router constructs the graph for its area(s) and
compute the shortest path.
The Network Layer in the Internet:
OSPF

The five types of OSPF messages.


The Network Layer in the Internet:
BGP – The Exterior Gateway Routing Protocol
• Exterior gateway protocol routers have to worry about
politics a great deal.
• Typical policies involve political, security, or economic
considerations. A few examples of routing constraints
are
1.No commercial traffic for educat. network
2.Never put Iraq on route starting at Pentagon
3.Choose cheaper network
4.Choose better performing network 5.Don’t
go from Apple to Google to Apple
The Network Layer in the Internet:
BGP
• BGP routers communicate with each other
by establishing TCP connections.
• BGP is fundamentally a distance vector protocol, but
quite different from most others such as RIP.
– Each BGP router keeps track of the path
used (instead of maintaining just the cost to
each destination)
– Each BGP router tells its neighbors the exact path it
is using (instead of periodically given each
neighbor its estimated cost to each possible
destination)
The Network Layer in the Internet:
BGP
Routing policies between four Autonomous Systems
The Network Layer in the Internet:
BGP
Propagation of BGP route advertisements
The Network Layer in the Internet:
Internet Multicasting
• Databases, transmitting stock quotes to multiple
brokers, and handling digital conference telephone calls
• IP supports multicasting, using class D address.
• Two kinds of group addresses are supported: permanent
addresses and temporary ones. Some permanent group
examples:
– 224.0.0.1: All systems on a LAN
– 224.0.0.2: All routers on a LAN
– 224.0.0.5: All OSPF routers on a LAN
– 224.0.0.6: All designated OSPF routers on a LAN
– 224.0.0.251: All DNS servers on a LAN
The Network Layer in the Internet:
Internet Multicasting
• Multicasting is implemented by special multicast routers,
which may or may not be collocated with the standard
routers.
– About once a minute, each multicast router sends a
hardware multicast to the hosts on its LAN asking
them to report back on the groups their processes
currently belong to.
– Each host sends back responses for all the class D
addresses it is interested in.
– This query and response packets use a protocol called
IGMP (Internet Group Management Protocol).
• Multicast routing is done using spanning trees.
The Network Layer in the Internet:
Mobile IP
The Network Layer in the Internet:
Mobile IP
• Every site that wants to allow its users to roam has to
create a home agent.
• Every site that wants to allow visitors has to create a
foreign agent.
• When a mobile host shows up at a foreign site,
– it contacts the foreign agent there and register.
– The foreign agent then contacts the user's home agent
and gives it a care-of address, normally the foreign
agent's own IP address.
The Network Layer in the Internet: Mobile IP
Homework
• 1
• 6
• 18
• 22
• 31
• 32
• 33
• 42
• 1.Give two example computer applications for
which connection-oriented service is
appropriate. Now give two examples for
which connectionless service is best.
• 6. Consider the network of Fig. 5-12(a).
Distance vector routing is used, and the
following vectors have just come in to router
C: from B: (5, 0, 8, 12, 6, 2); from D: (16, 12,
6, 0, 9, 10); and from E: (7, 6, 3, 9, 0, 4). The
cost
of the links from C to B, D, and E, are 6, 3, and
5, respectively. What is C’s new routing table?
Give both the outgoing line to use and the
cost.
• 18. A token bucket scheme is used for traffic
shaping. A new token is put into the bucket
every 5 μsec. Each token is good for one
short packet, which contains 48 bytes of data.
What is the maximum sustainable data rate?
• 22. Consider the user of differentiated services
with expedited forwarding. Is there a
guarantee that expedited packets experience a
shorter delay than regular packets? Why or
why not?
• 31. A router has just received the following
new IP addresses: 57.6.96.0/21, 57.6.104.0/21,
57.6.112.0/21, and 57.6.120.0/21. If all of
them use the same outgoing line, can they be
aggregated? If so, to what? If not, why not?
• 32. The set of IP addresses from 29.18.0.0 to
19.18.128.255 has been aggregated to
29.18.0.0/17. However, there is a gap of 1024
unassigned addresses from 29.18.60.0 to
29.18.63.255 that are now suddenly assigned to a
host using a different outgoing line. Is it now
necessary to split up the aggregate address into its
constituent blocks, add the new block to the
table, and then see if any reaggregation is
possible? If not, what can be done instead?
• 33. A router has the following (CIDR) entries in its routing
table: Address/mask Next hop
135.46.56.0/22 Interface 0
135.46.60.0/22 Interface 1
192.53.40.0/23 Router 1
default Router 2
For each of the following IP addresses, what does the router do if
a packet with that address arrives?
(a) 135.46.63.10
(b) 135.46.57.14
(c) 135.46.52.2
(d) 192.53.40.7
(e) 192.53.56.7
• 42. When the IPv6 protocol is introduced,
does the ARP protocol have to be changed? If
so, are the changes conceptual or technical?

You might also like