Transcript Lecture 5

CEN 4500
Data Communications
Chapter 5: The Network Layer
Instructor: S. Masoud Sadjadi
http://www.cs.fiu.edu/~sadjadi/Teaching/
sadjadi At cs Dot fiu Dot edu
Recap: Network Layer
•
Network layer is the lowest layer that deals with
end-to-end communications in the hierarchy of the
hybrid reference model.
•
It is concerned with getting packets from the source
all the way to the destination, which may require
many hops at intermediate routers along the way.
In contrast, the data link layer is concerned with
moving frames from one end of a wire to the other.
•
CEN 4500, S. Masoud Sadjadi
2
Recap: Network Layer
•
To achieve its goals, network layer
–
–
–
–
must know about the topology of the
communication subnet (i.e., the set of all routers)
choose appropriate paths through the subnet
avoid overloading some of the communication
lines and routers while leaving others idle
handle the problems that might occur as a result
of source and destination being in different
networks.
CEN 4500, S. Masoud Sadjadi
3
Agenda
•
•
•
•
•
•
•
Design Issues
Routing Algorithms
Congestion Control Algorithms
Quality of Service
Internetworking
The Network Layer in the Internet
Summary
CEN 4500, S. Masoud Sadjadi
4
Network Layer Design Issues
•
•
The service provided to the transport layer
Internal design of the subnet
•
We will discuss
–
–
–
–
–
Store-and-Forward Packet Switching
Services Provided to the Transport Layer
Implementation of Connectionless Service
Implementation of Connection-Oriented Service
Comparison of Virtual-Circuit and Datagram
Subnets
CEN 4500, S. Masoud Sadjadi
5
Store-and-Forward Packet Switching
•
In the store-and-forward mechanism, the
equipment is used as follows
–
A host with a packet to send transmits it to the
nearest router
•
•
–
–
Either on its own LAN
Or over a point-to-point link to the carrier
The packet is stored there until it has fully arrived
so the checksum can be verified.
Then it is forwarded to the next router along the
path until it reaches the destination host, where it
is delivered
CEN 4500, S. Masoud Sadjadi
6
Store-and-Forward Packet Switching
•
The major component of the system
–
–
Routers
Transmission lines
Leased line
Leased line
The environment of the network layer protocols.
CEN 4500, S. Masoud Sadjadi
7
Services Provided to the Transport Layer
•
Design Goals for Network Layer Services
–
–
–
•
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 across LANs and WANs.
A lot of freedom in writing detailed
specifications of the services!
–
Connectionless OR Connection-Oriented?
CEN 4500, S. Masoud Sadjadi
8
Services Provided to the Transport Layer
•
Internet Community Camp (30 years old)
–
–
–
The routers’ job is moving packets around.
The subnet is inherently unreliable, no matter how it
is designed, therefore, the hosts should accept the fact
that the network is unreliable.
Therefore, the network layer should be connectionless
•
•
•
with primitives like SEND PACKET and RECEIVE
PACKET
No packet ordering and flow control.
Each packet must be independent and must carry the full
destination address.
CEN 4500, S. Masoud Sadjadi
9
Services Provided to the Transport Layer
•
Telephone Companies Camp (100 years old)
–
–
–
The subnet should provide a reliable, connectionoriented service.
100 years of successful experience with
worldwide telephone system is an excellent
guide.
Quality of service is the dominant factor, and
without connections in the subnet, quality of
service is very difficult to achieve, especially for
real-time traffic such as voice and video.
CEN 4500, S. Masoud Sadjadi
10
Connectionless & Connection-Oriented Service
•
Connectionless service
–
–
–
–
•
Packets are injected into the subnet individually and
routed independently of each other
No advance setup is needed.
The packets are frequently called datagrams, in analogy
with telegrams
The subnet is called a datagram subnet.
Connection-oriented service
–
–
–
A path from the source to the destination router must be
established before any data packets can be sent.
This connection is called a VC (Virtual Circuit), in
analogy with the physical circuits set up by the telephone
systems
The subnet is called a virtual circuit subnet.
CEN 4500, S. Masoud Sadjadi
11
Implementation of Connectionless Service
•
How the datagram subnet works?
–
–
–
–
Suppose that a process P1 on host H1 has a long message
for P2 on host H2.
P1 hands the message to its transport layer with
instructions to deliver it to P2 on host H2.
The transport layer, probably running as part of the
operating system, adds a header to the message and hands
the result to the network layer, which might be just
another procedure within the operating system.
Let’s assume that the message is 4 times longer than the
maximum packet size, so the network layer has to break it
into 4 packets.
CEN 4500, S. Masoud Sadjadi
12
Implementation of Connectionless Service
Routing within a datagram subnet.
CEN 4500, S. Masoud Sadjadi
13
Implementation of Connectionless Service
•
How the datagram subnet works (cont.)?
–
–
–
–
–
–
–
Packets 1, 2, 3, and 4 are sent in turn to router A using
some point to point data link protocol.
At this point the carrier takes over.
Every router has an internal table telling it where to send
packets for each possible destination.
Each table entry is a pair consisting of a destination and
the outgoing line to use for that destination.
Only directly connected lines can be used.
As the packets arrive at A, they briefly stored (to verify
the checksum) and then forwarded to C
Packet 4 however, is forwarded to B for some reason …
CEN 4500, S. Masoud Sadjadi
14
Implementation of Connectionless Service
•
Reasons for different routing of packets
–
–
–
–
•
A may have learned about a traffic jam along
ACE.
A may have learned about a network outage.
A is trying to provide a load balancing
…
Routing Algorithm
–
The algorithm that manages the tables and makes
the routing decisions
CEN 4500, S. Masoud Sadjadi
15
Implementation of Connection-Oriented Service
•
•
•
•
•
•
For connection-oriented service, we need a virtualcircuit subnet.
The idea behind VC is to avoid having to choose a
new route for every packet sent.
Instead, when a connection is established, a route
from the source machine to the destination machine is
chosen as part of the connection setup and stored in
tables inside the routers.
That route is used for all traffic flowing over the
connection, exactly the same way that the telephone
system works.
When the connection is released, the vc is terminated.
Note that each packet carries a vc identifier.
CEN 4500, S. Masoud Sadjadi
16
Implementation of Connection-Oriented Service
•
To avoid conflicts, routers need the ability to replace
connection identifiers in outgoing packets
Routing within a virtual-circuit subnet.
CEN 4500, S. Masoud Sadjadi
17
Comparison of Virtual-Circuit and Datagram Subnets
5-4
CEN 4500, S. Masoud Sadjadi
18
Agenda
•
•
•
•
•
•
•
Design Issues
Routing Algorithms
Congestion Control Algorithms
Quality of Service
Internetworking
The Network Layer in the Internet
Summary
CEN 4500, S. Masoud Sadjadi
19
Routing Algorithms
•
The main function of the network layer is routing
packets from the source machine to the destination
machine.
–
•
•
In most subnets, packets will require multiple hops to make
the journey.
The algorithm that choose the routes and the data
structures that they use are a major are of network
layer design.
The Routing Algorithm is that part of network layer
software responsible for deciding which output line an
incoming packet should be transmitted on.
–
–
For datagram subnets, this decision is make for every packet
For vc subnets, this decision is made only when a new vc is
being set up.
CEN 4500, S. Masoud Sadjadi
20
Routing Algorithms
•
A router has two processes
–
Routing
•
•
–
Forwarding
•
•
•
Making the decision on which route to use.
Updates the routing tables.
What happens when a packet arrives.
Uses the routing tables.
Desirable properties of routing algorithms
–
Correctness, simplicity, robustness, stability,
fairness, and optimality.
CEN 4500, S. Masoud Sadjadi
21
Routing Algorithms: Trade-Offs
•
•
Suppose that there are enough traffic between (A,
A’), (B, B’), and (C, C’) to saturate the horizontal
links.
To maximize the throughput, it is better to shut
down the traffic between (X, X’)!
Conflict between fairness and optimality.
CEN 4500, S. Masoud Sadjadi
22
Agenda
•
•
Design Issues
Routing Algorithms
–
–
–
–
–
•
•
•
•
•
The Optimality Principle
Shortest Path Routing
Flooding
Distance Vector Routing
Link State Routing
Congestion Control Algorithms
Quality of Service
Internetworking
The Network Layer in the Internet
Summary
CEN 4500, S. Masoud Sadjadi
23
The Optimality Principle
•
•
Optimality Principle: If router J is on the optimal path from
router I to router 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 (called sink tree) rooted at the destinations.
A subnet.
A sink tree for router B.
CEN 4500, S. Masoud Sadjadi
24
The Optimality Principle
•
•
•
•
•
•
A sink tree is not unique!
The goal of all routing algorithms is to discover and use the sink
trees for all routers.
Sink tree does not contain any loops (because in fact it is a tree),
so each packet will be delivered within a finite and bounded
number of hops.
Note that links and routers can go down, so each router may have
a different ideas about the current topology.
So, different routing algorithms may perform differently with
respect to how they address these problems and how they acquire
the required information.
The optimality principle and the sink tree provide a benchmark
against which other routing algorithms can be measured.
CEN 4500, S. Masoud Sadjadi
25
Agenda
•
•
Design Issues
Routing Algorithms
–
–
–
–
–
•
•
•
•
•
The Optimality Principle
Shortest Path Routing
Flooding
Distance Vector Routing
Link State Routing
Congestion Control Algorithms
Quality of Service
Internetworking
The Network Layer in the Internet
Summary
CEN 4500, S. Masoud Sadjadi
26
Shortest Path Routing
•
•
•
We start the study of feasible routing algorithms
with a widely used technique.
The idea is to find the shortest path between two
routers in the graph.
Path length can be measured by
–
–
–
•
number of hops
geographical distance
mean queuing and transmission delay
This is a static algorithm due to Dijkstra (1959).
CEN 4500, S. Masoud Sadjadi
27
Shortest Path Routing
•
How the algorithm works?
–
–
–
–
–
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
labeled with infinity.
As the algorithm proceeds and paths are found,
the labels may change, reflecting better paths.
A label may be either tentative or permanent.
When it is discovered that a label represents the
shortest possible path from the source to that
node, it is made permanent.
CEN 4500, S. Masoud Sadjadi
28
Shortest Path Routing
•
The first 5 steps used in computing the shortest path
from A to D. The arrows indicate the working node.
CEN 4500, S. Masoud Sadjadi
29
Shortest Path Routing
•
Dijkstra's algorithm to compute the shortest path through a graph.
5-8 top
CEN 4500, S. Masoud Sadjadi
30
Shortest Path Routing
5-8
bottom
CEN 4500, S. Masoud Sadjadi
31
Agenda
•
•
Design Issues
Routing Algorithms
–
–
–
–
–
•
•
•
•
•
The Optimality Principle
Shortest Path Routing
Flooding
Distance Vector Routing
Link State Routing
Congestion Control Algorithms
Quality of Service
Internetworking
The Network Layer in the Internet
Summary
CEN 4500, S. Masoud Sadjadi
32
Flooding
•
•
Another static algorithm, in which every
incoming packet is sent out on every outgoing
line except the one it arrived on.
It generates many duplicate packets.
–
–
•
Hop counter contained in the header
Keeping track of which packets have been
flooded
Selective Flooding is a variation of flooding
that is slightly more practical.
–
The routers send the packets only on those lines
that they think are in the right direction.
CEN 4500, S. Masoud Sadjadi
33
Flooding Applications
•
•
•
•
In military applications, the tremendous
robustness of flooding is highly desirable.
In distributed database applications, it is
sometimes necessary to update all the
databases concurrently.
In wireless networks, all messages
transmitted by a station can be received by all
other stations within its radio range.
As a metric against which other routing
algorithms can be compared.
CEN 4500, S. Masoud Sadjadi
34
Agenda
•
•
Design Issues
Routing Algorithms
–
–
–
–
–
•
•
•
•
•
The Optimality Principle
Shortest Path Routing
Flooding
Distance Vector Routing
Link State Routing
Congestion Control Algorithms
Quality of Service
Internetworking
The Network Layer in the Internet
Summary
CEN 4500, S. Masoud Sadjadi
35
Distance Vector Routing
•
•
As the static algorithms do not take into
account the current state of the network,
modern computer networks use a dynamic
algorithm instead.
The most popular dynamic algorithms
–
Distance Vector Routing
•
•
–
Algorithms operate by having each router maintain a
table (i.e., a vector) giving the best known distance to
each destination and which line to use to get there.
The original ARPANET routing algorithm and was
also used in the Internet under the name RIP.
Link State Routing
CEN 4500, S. Masoud Sadjadi
36
Distance Vector Routing
•
How the algorithm works?
–
–
–
The routers are assumed to know their distance
from their neighbors.
Once every T msec each router sends to each
neighbor a list of its estimated delays to each
destination.
Each router uses the new information to update its
table/vector.
CEN 4500, S. Masoud Sadjadi
37
Distance Vector Routing
(a) A subnet. (b) Input from A, I, H, K, and the new
routing table for J.
CEN 4500, S. Masoud Sadjadi
38
Distance Vector Routing
•
This algorithm converges to the correct answer, but
it may do so slowly.
–
It reacts quickly to good news, but leisurely to bad news!
Good news! A was down and is now up.
The count-to-infinity problem.
Bad news! A was up and is now down.
CEN 4500, S. Masoud Sadjadi
39
Agenda
•
•
Design Issues
Routing Algorithms
–
–
–
–
–
•
•
•
•
•
The Optimality Principle
Shortest Path Routing
Flooding
Distance Vector Routing
Link State Routing
Congestion Control Algorithms
Quality of Service
Internetworking
The Network Layer in the Internet
Summary
CEN 4500, S. Masoud Sadjadi
40
Link State Routing
•
Distance vector routing was used in the
ARPANET until 1979, when it was replaced by
link state routing.
–
–
•
•
The delay metric was queue length, it did not take
link bandwidth into account when choosing routes.
The algorithm often took too long to converge (the
count-to-infinity problem).
It was replaced by an entirely new algorithm,
Link State Algorithm
Variants of this algorithm are now widely used.
CEN 4500, S. Masoud Sadjadi
41
Link State Routing
•
Each router must do the following
1.
2.
3.
4.
5.
•
•
Discover its neighbors and learn their network addresses.
Measure the delay or cost to each of its neighbors.
Construct a packet telling all it has just learned.
Send this packet to all other routers
Computer the shortest path to every other router.
In effect, the complete topology and all delays are
experimentally measured and distributed to every
router.
Then Dijkstra’s algorithm can be used to find the
shortest path to every other router.
CEN 4500, S. Masoud Sadjadi
42
Learning about the Neighbors
•
When a router is booted, its first task is to learn who its
neighbors are.
–
–
Its sends a special HELLO packet on each of its point-to-point
lines.
The router on the other end is expected to send back a reply
telling who it is.
(a) Nine routers and a LAN.
CEN 4500, S. Masoud Sadjadi
(b) A graph model of (a).
43
Measuring Line Cost
•
•
By measuring the round-trip time and dividing it by two.
If we also consider the load, then the below network will
oscillate wildly (choosing between CF and EI)!
A subnet in which the East and West parts are connected by two lines.
CEN 4500, S. Masoud Sadjadi
44
Building Link State Packets
•
Once the information needed for the exchange has
been collected, the next step is for each router to build
a packet containing all the data.
Building the packets is easy, the had part is when to
build them
•
–
Periodically or When some significant event happens
(a) A subnet.
(b) The link state packets for this subnet.
CEN 4500, S. Masoud Sadjadi
45
Distributing the Link State Packets
•
The trickiest part of the algorithm is distributing the link state
packets reliably.
–
–
•
The fundamental idea is to use flooding
To keep the flood in check, each packet contains a sequence number
Each row corresponds to a recently-arrived, but not fully processed,
link state packet.
–
Where the packet originated, its sequence number and age, and the data.
must be acknowledged here
The packet must be sent
The packet buffer for router B in the previous slide
CEN 4500, S. Masoud Sadjadi
46
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.
Now, Dijkstra’s algorithm can be run locally to
construct the shortest path to all possible
destinations.
The results of this calculation can be installed in the
routing tables, and normal operation resumed.
The OSPF, which is widely used in the Internet, uses
a link state algorithm.
CEN 4500, S. Masoud Sadjadi
47
Agenda
•
•
•
•
•
•
•
Design Issues
Routing Algorithms
Congestion Control Algorithms
Quality of Service
Internetworking
The Network Layer in the Internet
Summary
CEN 4500, S. Masoud Sadjadi
59
Congestion Control
•
Congestion
–
•
When too many packets are present in (a part of)
the subnet, performance degrades.
Consequence
–
–
–
As traffic increases too far, the routers are no
longer able to cope and they begin losing packets.
This tends to make the matters worse.
At very high traffic, performance collapses
completely and almost no packets are delivered.
CEN 4500, S. Masoud Sadjadi
60
Congestion
When too much traffic is offered, congestion
sets in and performance degrades sharply.
CEN 4500, S. Masoud Sadjadi
61
Reasons for Congestion
•
More demand for bandwidth
–
•
•
•
If all of a sudden, streams of packets begin arriving on three
or four input lines and all need the same output line, a queue
will build up.
Slow processors in the routers
Low-bandwidth lines
Mismatch between parts of the system
–
•
Need to balance the components
Flow control is not congestion control
–
–
–
It relates to the point-to-point traffic between a given sender
and a given receiver.
The fast sender should not overwhelm the slow receiver.
Flow is a stream of packets from a source to a destination.
CEN 4500, S. Masoud Sadjadi
62
General Principles of Congestion Control
•
Monitor the system.
–
•
•
Detect when and where congestion occurs.
Pass information to where action can be
taken.
Adjust system operation to correct the
problem.
CEN 4500, S. Masoud Sadjadi
63
Congestion Prevention Policies
•
Minimizing congestion in the first place, rather than letting it
happen and reacting after the fact.
5-26
CEN 4500, S. Masoud Sadjadi
Policies that affect congestion.
64
Congestion Control in Virtual-Circuit Subnets
(a) A congested subnet. (b) A redrawn subnet,
eliminates congestion and a virtual circuit
from A to B.
CEN 4500, S. Masoud Sadjadi
65
Agenda
•
•
•
•
•
•
•
Design Issues
Routing Algorithms
Congestion Control Algorithms
Quality of Service
Internetworking
The Network Layer in the Internet
Summary
CEN 4500, S. Masoud Sadjadi
68
Quality of Service
•
•
•
The techniques for congestion control are designed
to reduce congestion and improve network
performance.
However, with the growth of multimedia
networking, often these ad hoc measures are not
enough.
Serious attempts at guaranteeing quality of service
through network and protocol design are needed.
These are some advance topics in networking and we
will not spend time on them.
CEN 4500, S. Masoud Sadjadi
69
Agenda
•
•
•
•
•
•
•
Design Issues
Routing Algorithms
Congestion Control Algorithms
Quality of Service
Internetworking
The Network Layer in the Internet
Summary
CEN 4500, S. Masoud Sadjadi
83
Internetworking
•
Many different networks exist
–
•
•
Numerous protocols are in widespread use in
every layer.
What happens when two or more networks
are connected to form a internet?
–
•
LANs, MANs, and WANs.
This is the topic of our discussion in this part!
Purpose of internetworking: to allow users on
any of the networks to communicate with
users and access data on all the other ones.
CEN 4500, S. Masoud Sadjadi
84
Reasons for Having Different Networks
•
Cost Involved
–
•
The installed base of different networks is large.
Decision Process
–
•
As the computers get cheaper, the decisions for what
computer to buy and what protocol to use go down in the
organizations.
Hardware Variety
–
Different networks have radically different technology
(e.g., ATM and Wireless), so it should not be surprising
that as new hardware developments occur, new software
will be created to fit the new hardware.
CEN 4500, S. Masoud Sadjadi
85
Topics in Internetworking
•
•
•
How Networks Differ
How Networks Can Be Connected
Styles of internetworking
–
–
•
•
•
Concatenated Virtual Circuits
Connectionless Internetworking
Tunneling
Internetwork Routing
Fragmentation
CEN 4500, S. Masoud Sadjadi
86
How Networks Differ
•
Some of the many ways networks can differ.
5-43
CEN 4500, S. Masoud Sadjadi
87
How networks can be connected?
(a) Which device is in which layer.
(b) Frames, packets, and headers.
CEN 4500, S. Masoud Sadjadi
88
How Networks Can Be Connected
(a) Two Ethernets connected by a switch.
(b) Two Ethernets connected by routers.
CEN 4500, S. Masoud Sadjadi
89
Connecting Networks
A collection of interconnected networks.
CEN 4500, S. Masoud Sadjadi
90
Concatenated Virtual Circuits
•
Internetworking using concatenated virtual
circuits.
CEN 4500, S. Masoud Sadjadi
91
Concatenated Virtual Circuits
•
•
•
•
•
A connection to a host in a distant network is set up
in a way similar to the way connections are
normally established.
The subnet sees that the destination is remote and
builds a virtual circuit to the router nearest the
destination network.
Then it constructs a virtual circuit from that router to
an external gateway (multi-protocol router).
This build another virtual circuit to a router in the
next subnet.
This process continues until the destination hos has
been reached.
CEN 4500, S. Masoud Sadjadi
92
Connectionless Internetworking
•
•
The alternative model to the Concatenated Virtual Circuits
The only service that the network layer offers to the transport
layer is the ability to inject datagrams into the subnet and
hope for the best.
A connectionless internet.
CEN 4500, S. Masoud Sadjadi
93
Connectionless Internetworking
•
This approach does not require all the packets
belonging to one connection to traverse the same
sequence of gateways.
A routing decision is made for each packet.
Problems
•
•
–
Translation
•
–
Multi-protocol routers actually trying to translate from one format
to another, but unless the two formats are close relatives with the
same information fields, such conversions will always be
incomplete and often doomed to failure.
Addressing
•
A host on the Internet is trying to send an IP packet to a host on an
adjoining SNA network.
CEN 4500, S. Masoud Sadjadi
94
Tunneling
•
•
•
•
•
Handling the general case of making two different
networks interwork is exceedingly difficult.
However, there is a common special case that is
manageable.
This case is where the source and destination are
on the same type of network, but there is a different
network in between.
The solution to this problem is Tunneling.
The WAN in between can be seen as a big tunnel
extending from one multiprotocol router to the
other.
CEN 4500, S. Masoud Sadjadi
95
Tunneling
•
Tunneling a packet from Paris to London.
CEN 4500, S. Masoud Sadjadi
96
Tunneling
•
Tunneling a car from France to England.
CEN 4500, S. Masoud Sadjadi
97
Internetwork Routing
•
(a) An internetwork.
–
•
The internetwork of five networks by six
(possibly multi-protocol) routers.
(b) A graph of the internetwork.
CEN 4500, S. Masoud Sadjadi
98
Internetwork Routing
•
Routing through an internetwork is similar to routing
within a single subnet, but with some added
complications.
Once the graph has been constructed, then known
algorithms, such as distance vector and link state
algorithms, can be applied to the set of multi-protocol
routers.
This gives two-level routing algorithm
•
•
–
–
–
–
Routing within each network (Interior Gateway Protocol)
Routing between the networks (Exterior Gateway Protocol)
Note: “Gateway” is an older term for “Router”.
Because each network in an internetwork is independent of
all the others, it is called an “Autonomous System (AS)”.
CEN 4500, S. Masoud Sadjadi
99
Internetwork Routing
•
Differences between inter and intra-network
routing
–
Internetwork routing may require crossing
international boundaries.
•
•
–
Cost
•
–
So, various laws suddenly become to play!
Canadian Law: The data traffic originating in Canada and
ending in Canada may not leave the country.
Within a single network, a single charging algorithm is
normally applied.
Quality of Service
•
The QoS offered by different networks might be different.
CEN 4500, S. Masoud Sadjadi
100
Fragmentation
•
Each network imposes some maximum size on
its packets. Causes could be:
–
–
–
–
–
–
Hardware (e.g., the size of an Ethernet frame).
Operating System (e.g., all buffers are 512 bytes).
Protocols (e.g., the number of bits in the packet
length field). ATM 48 B and IP 65,515B payloads.
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.
CEN 4500, S. Masoud Sadjadi
101
Fragmentation
•
Problem
–
•
When a large packet wants to travel through a
network whose maximum packet size is too small.
Solution
–
To make sure the problems does not occur in the
first place.
•
–
The internet should use a routing algorithm that avoids
sending packets through networks that cannot handle
them.
To allow gateways to break up the packets into
fragments, sending each fragment as a separate
internet packet.
CEN 4500, S. Masoud Sadjadi
102
Fragmentation
•
•
(a) Transparent fragmentation.
(b) Nontransparent fragmentation.
CEN 4500, S. Masoud Sadjadi
103
Agenda
•
•
•
•
•
•
•
Design Issues
Routing Algorithms
Congestion Control Algorithms
Quality of Service
Internetworking
The Network Layer in the Internet
Summary
CEN 4500, S. Masoud Sadjadi
105
The Network Layer in the Internet
•
•
•
•
•
•
•
•
The IP Protocol
IP Addresses
Internet Control Protocols
OSPF – The Interior Gateway Routing Protocol
BGP – The Exterior Gateway Routing Protocol
Internet Multicasting
Mobile IP
IPv6
CEN 4500, S. Masoud Sadjadi
106
Design Principles for Internet
•
•
•
•
•
•
•
•
•
•
Make sure it works.
Keep it simple.
Make clear choices.
Exploit modularity.
Expect heterogeneity.
Avoid static options and parameters.
Look for a good design; it need not be perfect.
Be strict when sending and tolerant when receiving.
Think about scalability.
Consider performance and cost.
CEN 4500, S. Masoud Sadjadi
107
Collection of Subnetworks
The Internet is an interconnected collection of many networks.
CEN 4500, S. Masoud Sadjadi
108
The IP Protocol
•
An IP datagram consists of a header and a text part.
–
Header has 20B fixed part and a variable length optional part,
transmitted in the big-endian order.
How long the header is in 32-bit words, the min is 5
Changed its meaning over the years
Don’t Fragment
More Fragments
All the fragments of
a datagram have
the same id
Originally meant to
be number of
seconds to live, but
in practice, it is
number of the
hops!
TCP, UDP, etc.
CEN 4500, S. Masoud Sadjadi
The IPv4 (Internet Protocol) header.
109
The IP Protocol
Some of the IP options.
5-54
CEN 4500, S. Masoud Sadjadi
110
IP Addresses
•
In principle, no two machines on the Internet have
the same IP address.
IP addresses are 32 bits long.
IP address does not actually refer to a host, but to a
network interface.
Classified Addressing
•
•
•
–
–
•
For several decades, IP addresses were divided into five
categories: A, B, C, D, and E.
It is no longer in use!
Network numbers are managed by ICANN (Internet
Corporation for Assigned Names and Numbers).
CEN 4500, S. Masoud Sadjadi
111
IP Addresses
IP address formats.
CEN 4500, S. Masoud Sadjadi
112
IP Addresses
Special IP addresses.
CEN 4500, S. Masoud Sadjadi
113
Subnets
•
All the hosts in a network must have the same
network number.
This property may cause problem as networks grow.
The problem
•
•
–
•
the rule that a single class A, B, or C address refers to one
network, not to a collection of networks.
The solution
–
–
to allow a network to be split into several parts for internal
use but still act like a single network to the outside world.
Some bits are taken away from the host number to create a
subnet number.
•
Note: In the Internet literature, the parts of the
network are called subnets and it does NOT mean the
set of routers and communications lines in a network.
CEN 4500, S. Masoud Sadjadi
114
Subnets
A campus network consisting of LANs for
various departments.
CEN 4500, S. Masoud Sadjadi
115
Subnets
A class B network subnetted into 64 subnets.
CEN 4500, S. Masoud Sadjadi
116
How IP packets are processed?
•
Each router has a table listing some number of
(network, 0) IP addresses and some number of
(this-network, host) IP addresses.
–
–
–
–
The first kind tells how to get to distant networks.
The second kind tells how to get to local hosts.
Associated with each table is the network
interface to use to reach the destination, and
certain other information.
Therefore, each router has to keep track of other
networks and local hosts, and NOT (network,
host) pairs.
CEN 4500, S. Masoud Sadjadi
117
How the subnets work?
•
When subnetworking is used, the routing
tables are changed, adding entries of the form
–
–
•
•
(this-network, subnet, 0)
(this-network, this-subnet, host)
Thus, a router on subnet k knows how to get
to all the other subnets and also how to get to
all the hosts on subnet k.
Subnetworking thus reduces router table
space by creating a three-level hierarchy
consisting of network, subnet, and host.
CEN 4500, S. Masoud Sadjadi
118
CIDR – Classless InterDomain Routing
•
•
•
•
Unfortunately, IP is rapidly becoming a victim
of its own popularity: it is running out of
addresses!
100,000th network was connected in 1996!
In principle, over 2 billion addresses exist, but
the practice of organizing the address space by
classes wastes millions of them.
The Three-Bear Problem
–
–
–
The real villain is class B network.
For most orgs, A is too big, and C is too small.
B is just right!
CEN 4500, S. Masoud Sadjadi
119
CIDR – Classless InterDomain Routing
•
Many solutions were proposed
–
–
•
Some solved some of the problems
And introduced other problems.
The solution that was implemented and that
gave the Internet a bit of breathing room is
CIDR (Classless InterDomain Routing).
–
–
It allows allocation of remaining IP addresses in a
variable-sized blocks, without regard to the classes.
If a site needs, say 2000 addresses, it is given a
block of 2048 addresses.
CEN 4500, S. Masoud Sadjadi
120
How routing works with CIDR?
•
Dropping the classes makes forwarding more
complicated.
Old approach:
•
–
–
–
–
–
When a packet arrives at a router, a copy of the IP address
was shifted right 28 bits to yield a 4-bit class number.
A 16-way branch then sorted packets into A, B, C, D, and
E, with 8 of the cases for class A, four for class B, two for
class C, and one for D and one for E.
Then the code for class masks off the 8-, 16-, or 24-bit
network number and right aligned it in a 32 bit word.
The network number was then looked up in the A, B, or C
table, usually by indexing for A and B networks and
hashing for C networks.
Once the entry was found, the outgoing line can be looked
up and the packet can be forwarded.
CEN 4500, S. Masoud Sadjadi
121
How routing works with CIDR?
•
With CIDR, this simple algorithm no longer works!
–
–
Each routing table is extended by giving it a 32-bit mask.
Thus, there is now a single routing table for all networks
consisting of an array of
•
–
–
–
(IP address, subnet mask, outgoing line)
When a packet comes in, its destination IP address is first
extracted, and conceptually the routing table is scanned
entry by entry, masking the destination address and
comparing it to the table entry looking for a match.
It is possible that multiple entries (with different subnet
mask lengths) match, in which case the longest mask is
used.
Custom VLSI chips have been developed for this.
CEN 4500, S. Masoud Sadjadi
122
CIDR – Example
•
Addresses are available starting at 194.24.0.0
–
–
Cambridge Univ. needs 2048 addresses
Oxford Univ. needs 4096 addresses
•
•
–
Cannot start from 192.24.8.0
A block of 4096 must lie on a 4096-byte boundary
University of Edinburgh needs 1024 addresses
A set
of IP
address
assignments.
CEN
4500,
S. Masoud
Sadjadi
123
NAT – Network Address Translation
•
•
IP Addresses are scarce
An ISP may have a /16 address, but it may
need more!
–
–
For home customers with dial-up connections,
one way around the problem is to dynamically
assign an IP address to a computer when it calls
up and logs in an take it back when the session
ends.
But this fails for ISPs that primarily serve
business customers.
CEN 4500, S. Masoud Sadjadi
124
NAT – Network Address Translation
Placement and operation of a NAT box.
CEN 4500, S. Masoud Sadjadi
125
Internet Control Message Protocol
•
•
In addition to IP, which is used primarily for data transfer,
there are other protocols in the network layer: ICMP, ARP,
RARP, BOOTP, and DHCP.
ICMP is used to report unexpected events, so that routers can
monitor the operation of the Internet.
CEN 4500,ICMP
S. Masoud
Sadjaditypes.
The principal
message
126
ARP– The Address Resolution Protocol
•
How do IP addresses get mapped onto data link layer address,
such as Ethernet?
The IP software can look at the address and see that the dest. is on
its own network, but what is the dest’s Ethernet Addr.
•
–
–
Have a configuration file
Output a broadcast packet onto the Ethernet, asking who owns this IP
address?
CEN 4500, S. Masoud Sadjadi
Three interconnected /24
networks: two Ethernets and an FDDI ring.
127
Dynamic Host Configuration Protocol
•
•
A special server assigns IP addresses to hosts
asking for one.
The server needs not to be on the same LAN
as the requesting host.
CEN 4500, of
S. Masoud
Operation
DHCP.Sadjadi
128
OSPF – The Interior Gateway Routing
Protocol, which is a link state protocol
(a) An autonomous system. (b) A graph representation of (a).
CEN 4500, S. Masoud Sadjadi
129
OSPF (2)
•
The relation between ASes, backbones, and
areas in OSPF.
CEN 4500, S. Masoud Sadjadi
130
OSPF (3)
The five types of OSPF messeges.
5-66
CEN 4500, S. Masoud Sadjadi
131
BGP – The Exterior Gateway Routing
Protocol, which is a distance vector
protocol
(a) A set of BGP routers.
(b) Information sent to F.
CEN 4500, S. Masoud Sadjadi
132