Module-3 PPT
Module-3 PPT
• 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)
(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”.
• 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
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) 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
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