Professional Documents
Culture Documents
Goals
understand principles behind network layer services:
network layer service models
forwarding versus routing
how a router works
routing (path selection)
broadcast, multicast
instantiation, implementation in the Internet
Two key network-layer functions
forwarding: move packets from router’s input to appropriate router output
routing: determine route taken by packets from source to dest.
routing algorithms
analogy:
routing: process of planning trip from source to dest
forwarding: process of getting through single interchange
The user messages are split up into packets of a fixed maximum size .
The packet can choose any path to carry the message.
The whole user messages are reassembled at the destination node.
This can significantly reduce the transmission time between the sender and receiver.
Two Types
Virtual Circuits
Datagrams
Datagram
Example: Internet
No delivery assurance relating to the packets as the packets can be lost, out-of-sequence,
contaminated, duplicated etc.
Transaction (Sending a short message), connectionless oriented (No need to establish call prior
to sending data.)
Virtual Circuits
Packets are delivered in order,since they all take the same route;
The connection is more reliable, network resources are allocated at call setup so that even
during times of congestion, provided that a call has been setup, the subsequent packets
should get through;
Billing is easier, since billing records need only be generated per call and not per packet.
The switching equipment needs to be more powerful, since each switch needs to store
details of all the calls that are passing through it and to allocate capacity for any traffic
that each call could generate;
Message Switching
The source comp sends the data to the switching office first which stores the data in its
buffer.
It then looks for a free link to another switching office and then sends the data to this office.
Process is continued till the data is delivered to the destination computer.
It is also known as store and forward technique.
Advantages:
Disadvantages
3.3Network performance
Network performance is measured in two fundamental ways .
Bandwidth (or) throughput
Latency (or) delay
Bandwidth and Latency
Network performance is measured in two fundamental ways: bandwidth (also called
throughput) and latency (also called delay).
Bandwidth
The bandwidth of a network is given by the number of bits that can be transmitted over
the network in a certain period of time.
For digital devices, the bandwidth is usually expressed in bits per second(bps) or bytes
per second
Jitter:
Application requirements: Jitter
Example: voice (telephony)
A 1-MB file would fill the 1-Mbps link 80 times, but only fill the 1-Gbps link 1/12 of one
time
Application requirements: Jitter
An ipv4 address is a 32-bit address that uniquely and universally defines the connection of
a device (for example, a computer or a router) to the internet
AN IPV4 ADDRESS IS 32 BITS LONG
THE IPV4 ADDRESSES ARE UNIQUE AND UNIVERSAL
THE ADDRESS SPACE OF IPV4 IS 232 OR 4,294,967,296
GLOBAL ADDRESSES
IP addresses properties
Globally unique
Hierarchical: network + host
Network part: identifies the network the host is attached to
Host: identifies a unique host on that network
Ethernet addresses, even globally unique, are flat (no structure and thus no
meaning) and can not be use for routing
Note that a router is attached to at least twonetworks, so it must have an ip address
on each port/interface
Thus it is more precise to think of ip addresses as belonging to interfaces
rather than to hosts
Approximately, 4 billion ip address, half are a type, ¼ is b type, and 1/8 is c type
14 16
21 8
28
27
Format
4 bytes, each byte is represented by a decimal number
Dot notation
10.3.2.4
128.96.33.81
192.12.69.77
FIND THE CLASS OF EACH ADDRESS.
SOLUTION
The first bit is 0. This is a class a address.
B. The first 2 bits are 1; the third bit is 0. This is a class c
address.
The first byte is 14; the class is a.
The first byte is 252; the class is e.
Example .1
Change the following IPv4 addresses from binary notation to dotted-decimal notation.
a.10000001 00001011 00001011 11101111
b.11000001 10000011 00011011 1111111
Solution
We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add
dots for separation.
Example 2:
a.129.11.11.239
b.193.131.27.255
Solution
We replace each decimal number with its binary equivalent (see Appendix B)
Example 3
Change the following IPv4 addresses from dotted-decimal notation to binary notation
a.111.56.45.78
b.221.34.7.82
Solution
We replace each decimal number with its binary equivalent (see Appendix B)
H7 R3 H8
H1 H2 H3
Netw ork 4
R1
R2
H4
Netw ork 3 (FDDI)
H5 H6
ALGORITHM
If (networknum of destination = networknum of one of my interfaces) then
deliver packet to destination over that interface
Else
if (networknum of destination is in my forwarding table) then
deliver packet to nexthop router
else
deliver packet to default router
For a host with only one interface and only a default router in its forwarding table, this
simplifies to
If (networknum of destination = my networknum)then
deliver packet to destination directly
Else
deliver packet to default router
H7 R3 H8
H1 H2 H3
Netw ork 4
R1
R2
H4
Netw ork 3 (FDDI)
H5 H6
IP INTERNET
IP stands for internet protocol
Key tool used today to build scalable, heterogeneous internetworks
It runs on all the nodes in a collection of networks and defines the infrastructure that
allows these nodes and networks to function as a single logical internetwork
IP SERVICE MODEL
Two parts
Global Addressing Scheme
Provides a way to identify all hosts in the network
Datagram (Connectionless) model for data delivery
Best-effort delivery (unreliable service)
packets are lost
packets are delivered out of order
duplicate copies of a packet are delivered
packets can be delayed for a long time
Datagram format: IP header
0 4 8 16 19 31
Ident Flags Of f s et
Sourc eA ddr
DestinationA ddr
Pad
Options (variable)
(v ariable)
Data
IP HEADER
Version (4 bits):
O Currently 4 or 6.
O Also called ipv4 and ipv6
Hlen (4 bits):
O number of 32-bit words in header
O usually 5 32-bit words with no options
Tos (8 bits):
O Type of service (not widely used)
Length (16 bits):
O number of bytesin this datagram including the header
Size of datagram (in bytes, header + data)
Ident (16 bits) and flags/offset (16 bits):
O Used by fragmentation
Flags 3 bits: r (reserved bit set to 0) df (don't fragment ) mf (more fragments)
FLAGS/OFFSET (16 BITS):
Used by fragmentation
Protocol (the type of transport packet being carried (e.g. 1 = icmp; 6 = tcp; 17= udp).
Header checksum (a 1's complement checksum of ip header, updated whenever the
packet header is modified by a node. Packets with an invalid checksum are discarded
by all nodes in an ip network)
TTL (8 BITS):
O Number of hops/routers this packet can travel
Discard the looping packets
O Originally based on time, but changed to a hop-count based
O Each router decrements it by 1
O Discard the packet when it becomes 0
O Default is 64
DestAddr&SrcAddr (32 bits)
o The key for datagram delivery
o Every packet contains a full destination address
o Forwarding/routing decisions are made at each router
o The source address is for the destination to know the sender and if it wants to
reply to it
Problems
Setting it too high the packet will loop a lot
Setting it too low the packet will not reach the destination
SUPPOSE PPP HAS MTU OF 532-BYTE PACKET (20 HEADER + 512 PAYLOAD)
Header fields used in ip fragmentation. (a) unfragmented packet; (b) fragmented packets.
Mtu path discovery is a good strategy to avoid fragmentation
Send some packets first just discover the mtus on the path to the destination
SUBNETTING
Subnetting is a process of breaking large network in small networks known as subnets.
Subnetting happens when we extend default boundary of subnet mask. Basically we borrow host
bits to create networks.
Advantage of Subnetting
Subnetting breaks large network in smaller networks and smaller networks are easier to
manage.
Subnetting reduces network traffic
Improve performance.
It allows you to apply network security polices at the interconnection between subnets.
It allows you to save money by reducing requirement for IP range.
2 METHODS :
Boundary level
Non boundary level
BOUNDARY LEVEL
If masking IP address is 255 then subnet id is same as Network Ip address
If masking IP address is 0 then subnet id is also 0.
Ex:
NETWORK IP : 132.128.40.5
MASKING IP : 255.255. 0. 0
SUBNETTING IP : 132.128. 0. 0
NON-BOUNDARY LEVEL
Find binary equivalent for IP address and Masking IP.
Perform bitwise and operation with these two values.
EX:
IP : 132.147.28.6
MASKING IP : 255.92. 2. 0
SUBNETTING IP: 132.16. 0. 0
All the ICMP messages are different. The only thing that is common amongst all is the first 4
bytes.
Type field tells what type of message;
Code field gives further information on the type of message.
ERROR REPORTING
ICMP does not correct errors, it simply reports them.
ICMP always reports the message back to the source
Destination Unreachable
Source Quench
Time Exceeded
Parameter Problem
Redirection
Destination Unreachable
When a router cannot route a datagram or a host cannot deliver a datagram, the datagram is
discarded and the route ror host sends a destination-unreachable ICMP message.
Some subtypes of the “Destination Unreachable:
Source-quench format
There is no flow control mechanism in IP, so ICMP allows a router to tell a source to
slow down (we just discarded one of your datagrams because our buffers are full). This
is source quench.
One source quench message is sent for each datagram discarded.
Redirection concept
Routers are constantly updating themselves with new routing information. Not so with
hosts.
A host has to know where the next router is too, but its table is usually static (for
efficiency).
Host routing tables start off small, usually with only one entry - the default router.
When the host sends a datagram to the wrong router (because its routing table is
incomplete), the router that receives the datagram sends the datagram to the correct
router AND sends a redirection message to the host.
The host uses this info to update its routing table.
QUERY MESSAGES
ICMP can also diagnose some network problems through the query messages, a group of four
different pairs of messages. In this type of ICMP message, a node sends a message that is
answered in a specific format by the destination node.
How does a host find out what routers are connected to itsown network? Or if those routers are
functioning? It can send out a router-solicitation message.This can be broadcast on current
network.
Hierarchical Routing
Intra-domain Protocols
RIP: Route Information Protocol
Distance-vector algorithm
Based on hop-count
OSPF: Open Shortest Path First
More recent Internet standard
Uses link-state algorithm
Supports authentication
Autonomous System (AS)
• Collection of networks with same routing policy
• Single routing protocol
• Usually under single ownership, trust and administrative control
• What is an Autonomous System (AS)?
• A set of routers under a single technical administration, using an interior gateway
protocol (IGP) and common metrics to route packets within the AS and using an
exterior gateway protocol (EGP) to route packets to other AS’s
• Sometimes AS’s use multiple IGPs and metrics, but appear as single AS’s to other
AS’s
Distance Vector Routing Protocol: (16m)
A router running distance vector protocol advertises its connected routes and learns new routes
from its neighbors. The routing cost to reach a destination is calculated by means of hops
between the source and destination. A router generally relies on its neighbor for best path
selection, also known as “routing-by-rumors”. RIP and BGP are Distance Vector Protocols.
Distance Vector
Each node constructs a one dimensional array (a vector) containing the “distances”
(costs) to all other nodes and distributes that vector to its immediate neighbors
Starting assumption is that each node knows the cost of the link to each of its directly
connected neighbors
Initial distances stored at each node (global view)
This protocol acknowledges the state of a Link and advertises to its neighbors.
Information about new links is learnt from peer routers.
After all the routing information has been converged, the Link-State Routing Protocol
uses its own algorithm to calculate the best path to all available links.
OSPF and IS-IS are link state routing protocols and both of them use Dijkstra’s Shortest
Path First algorithm.
Strategy: Send to all nodes (not just neighbors) information about directly connected links (not
entire routing table).
Reliable Flooding
store most recent LSP from each node
forward LSP to all nodes but one that sent it
generate new LSP periodically; increment SEQNO
start SEQNO at 0 when reboot
decrement TTL of each stored LSP; discard when TTL=0
Link State
Reliable Flooding
In practice, each switch computes its routing table directly from the LSP’s it has collected
using a realization of Dijkstra’s algorithm called the forward search algorithm
Specifically each switch maintains two lists, known as Tentative and Confirmed
Each of these lists contains a set of entries of the form (Destination, Cost, NextHop)
The algorithm
Initialize the Confirmed list with an entry for myself; this entry has a cost of 0
For the node just added to the Confirmed list in the previous step, call it node Next, select
its LSP
For each neighbor (Neighbor) of Next, calculate the cost (Cost) to reach this Neighbor as the
sum of the cost from myself to Next and from Next to Neighbor
o If Neighbor is currently on neither the Confirmed nor the Tentative list, then add
(Neighbor, Cost, Nexthop) to the Tentative list, where Nexthop is the direction I go to reach
Next
o If Neighbor is currently on the Tentative list, and the Cost is less than the currently listed
cost for the Neighbor, then replace the current entry with (Neighbor, Cost, Nexthop) where
Nexthop is the direction I go to reach Next
If the Tentative list is empty, stop. Otherwise, pick the entry from the Tentative list with the
lowest cost, move it to the Confirmed list, and return to Step 2.
Router metrics
· Distance vector protocols are used in small networks, and it has a limited number of hops,
whereas Link state protocol can be used in larger networks, and it has unlimited number of hops.
· Distance vector protocol has a high convergence time, but in link state, convergence time is
low.
· Distance vector protocol periodically advertise updates, but link state advertises only new
changes in a network.
· Distance vector protocol advertises only the directly connected routers and full routing tables,
but link state protocols only advertise the updates, and flood the advertisement.
· In distance vector protocol, loop is a problem, and it uses split horizon, route poisoning and
hold down as loop preventing techniques, but link state has no loop problems.
Inter-domain Protocol
Border Gateway Protocol, version 4 (BGP-4)
Internet is an arbitrarily interconnected set of ASs
Each AS has a Speaker (advertiser)
Goal: Reachability than optimality
BGP Example
Routing Areas
AS divided into areas
Area 0
Known as the backbone area (connected to the backbone)
Area Border Routers (ABRs): R1, R2, R3
OSPF link state packets
Do not leave the area in which they originated (if they are not ABRs)
ABRs summarize routing information that they have learned from one area and
make it available in their advertisements to other areas.
2. Neighbor Reachability:
After acquiring a neighbor, a router checks to make sure the neighbor is reachable
and functioning properly on a regular basis.
This is done by sending an EGP Hello message to each neighbor for which a
connection has been established.
The neighbor replies with an I Heard You (IHU) message. These messages are
somewhat analogous to the BGP Keepalive message, but are used in matched
pairs.
Header Format
Marker
Marker: This large field at the start of each BGP message is used for synchronization and
authentication.
Length: The total length of the message in bytes, including the fields of the header.
Length- length of the data
Type: Indicates the BGP message type
Type Value(Decimal) Message Type
1 Open
2 Update
3 Notification
4 Keepalive
Advantages:
• Simplifies BGP
• No need for periodic refresh - routes are valid until withdrawn, or the connection
is lost
• Incremental updates
Disadvantages
• Congestion control on a routing protocol?
• Poor interaction during high load
What Is an EGP
• Exterior Gateway Protocol
• Used to convey routing information between Autonomous Systems
• De-coupled from the IGP
• Current EGP is BGP
Exterior
– specifically configured peers
– connecting with outside networks
– set administrative boundaries binds AS’s together
– Carries customer prefixes
– Carries Internet prefixes
– EGPs are independent of ISP network topology
Interior
– automatic neighbour discovery
– generally trust your IGP routers
– prefixes go to all IGP routers
– binds routers in one AS together
– Carries ISP infrastructure addresses only
– ISPs aim to keep the IGP small for efficiency and scalability
3.8Multicasting Basics
Multicast is communication between a single sender and multiple receivers on a network. ...
Together with anycast and unicast, multicast is one of the packet types in the Internet Protocol
Version 6 (IPv6).
3.8.1 IPV6 Addressing
MULTICAST ADDRESSES
A multicast address is a destination address for a group of hosts that have joined a multicast
group. A packet that uses a multicast address as a destination can reach all members of the
group unless there are some filtering restriction by the receiver.
The multicast addresses are in the range 224.0.0.0 through 239.255.255.255
–
IP Multicast Address Ranges and Uses
Range Start Range End
Description
Address Address
Reserved for special “well-known” multicast
224.0.0.0 224.0.0.255
addresses.
Fixed Header
An IPv6 packet is the smallest message entity exchanged via the Internet Protocol across an
Internet Protocol version 6 (IPv6) network.
Packets consist of control information for addressing and routing, and a payload consisting of
user data.
The control information in IPv6 packets is subdivided into a mandatory fixed header and
optional extension headers.
The payload of an IPv6 packet is typically a datagram or segment of the higher-level Transport
Layer protocol, but may be data for an Internet Layer (e.g., ICMPv6) or Link Layer (e.g., OSPF)
instead
Features
128-bit addresses (classless)
multicast
real-time service
authentication and security
autoconfiguration
end-to-end fragmentation
Expanded Address Space
IPv6 Address
128-bit address
3FFE:085B:1F1F:0000:0000:0000:00A9:1234
8 groups of 16-bit hexadecimal numbers separated by “:”
Leading zeros can be removed
3FFE:85B:1F1F::A9:1234
:: = all zeros in one or more group of 16-bit hexadecimal numbers
Packet format:
Traffic Class (8-bits): These 8 bits are divided into two parts. The most significant 6 bits are
used for Type of Service to let the Router Known what services should be provided to this
packet. The least significant 2 bits are used for Explicit Congestion Notification (ECN).
Priority:-
Priority Meaning
0 NO Traffic
1 Data
2 Un Attuned Data traffic
3 Reserved
4 Attended data traffic
5 Reserved
6 Traffic
7 Control Traffic
Flow Label (20-bits): This label is used to maintain the sequential flow of the packets belonging
to a communication. The source labels the sequence to help the router identify that a particular
packet belongs to a specific flow of information. This field helps avoid re-ordering of data
packets. It is designed for streaming/real-time media.
Payload Length (16-bits): This field is used to tell the routers how much information a
particular packet contains in its payload. Payload is composed of Extension Headers and Upper
Layer data. With 16 bits, up to 65535 bytes can be indicated; but if the Extension Headers
contain Hop-by-Hop Extension Header, then the payload may exceed 65535 bytes and this field
is set to 0.
Next Header (8-bits): This field is used to indicate either the type of Extension Header, or if the
Extension Header is not present then it indicates the Upper Layer PDU. The values for the type
of Upper Layer PDU are same as IPv4’s.
Extension header:
Extension Header Next Header Value Description
Hop-by-Hop Options header 0 Read by all devices in transit network
Routing header 43 Contains methods to support making
routing decision
Fragment header 44 Contains parameters of datagram
fragmentation
Destination Options header 60 Read by destination devices
Authentication header 51 Information regarding authenticity
Encapsulating Security 50 Encryption information
Payload header
IPV6 header
Hop-by-Hop options header
Destination Options header1
Routing header
Fragment header
Authentication header
Encapsulating Security Payload header
Destination Options hearder2
Upper-layer header
These headers:
1. Should be processed by First and subsequent destinations.
2. Should be processed by Final Destination.
Extension Headers are arranged one after another in a linked list manner, as depicted in the
following diagram:
Extension Headers Connected Forma
IPSec Scenario
IPSec Benefits
Provides strong security for external traffic
Resistant to bypass
Below transport layer hence transparent to applications
Can be transparent to end users
Can provide security for individual users if needed
Authentication Header
for authentication/integrity only
Encapsulating Security Payload (ESP)
for authentication/integrity/encryption (privacy)
A key exchange function
Manual or automated
VPNs usually need combined function
Address Types are :
Unicast : One to One (Global, Link local, Site local, Compatible)
Anycast : One to Nearest (Allocated from Unicast)
Multicast : One to Many
Reserved
• A single interface may be assigned multiple IPv6 addresses of any type (unicast, anycast,
multicast)
No Broadcast Address -> Use Multicast
Advantages of IPV6:
Larger address space
Better header format
New options
Allowance for extension
Support for resource allocation
Support for more security
Support for mobility
Payload ID for QoS in the header No identification Using Flow label field
Fragmentation Both router and the sending hosts Only supported at the
sending hosts
Resolve IP address to a link layer address broadcast ARP request Multicast Neighbor
Solicitation message
Determine the address of the best default ICMP Router ICMPv6 Router
gateway Discovery(optional) Solicitation and Router
Advertisement (required)