Professional Documents
Culture Documents
Layer 3
The Network Layer
• Fundamental function
• transport packet from sending to receiving hosts
• Addressing
• Uniquely identify each node in the network
• Routing
• Determine a path from source to destination and route packets along that path
Network layer functions
Protocol layering and data
• Each layer takes data from above
• Adds a header to create a new data unit
• Passes new data unit to the layer below
IP Protocol
IP connectionless
IP –Best effort delivery
IP encapsulation
IP addressing - Introduction
• Prefix calculation
/27
IPv4 golden rules
1. All hosts on the same L2 network must share the same prefix
2. All hosts with the same prefix have different host part
3. Host part of all-zeros and all-ones are reserved
1. Network 10.10.10.0/25
• How many addresses in total?
• How many usable addresses?
• What are the lowest and highest usable addresses?
2. Network 10.10.20.0/22
• How many addresses in total?
• How many usable addresses?
• What is the lowest and highest usable addresses?
IPv6 Addresses
• Since each L2 network needs its own prefix, then if you route
more than one network you need to divide your allocation
• Ensure each prefix has enough IPs for the number of hosts on
that network
Subnetting example
• Hence we use 8 and reserve the excess 2 subnets for future use.
Cont’d
• Since 8 = 2^3 hence 3 bits are required to enumerate the 8
subnets.
• Hence from the /24 bits it will need /27bits
• 27 bits can be denoted as 255.255.255.224
Defining the subnet
• A /27 bit network prefix leaves 5 bits to define the hosts
• However, since the all addresses all 0’s and all 1’s cannot be
allocated, there are 30
Disadvantages
• The administrator must really understand the internetwork and
how each router is connected to configure the routes correctly.
• Explicit addition of routes for all networks
• If one network is added to the internetwork, the administrator must add a route to
it on all routers.
• It’s not feasible in large networks because it would be a full-time
job.
Dynamic routing
• Dynamic routing is used by routers to share information about
the reachability and status of remote networks.
• It performs network discovery and maintains routing tables
• Interior Gateway
Protocols (IGP) -
• Used for routing within an AS
• Include RIP, EIGRP, OSPF,
and IS-IS
• Exterior Gateway
Protocols (EGP) -
• Used for routing between AS
• Official routing protocol used
by the Internet
Routing Protocols
• Routing protocols are used between routers to determine and
paths and maintain routing tables.
• Link-state routers know more about the internetwork than any distance-
vector routing protocol.
• Link state protocols forward updates when the state of a link changes
u v subnet hops
u 1
A B w
v 2
w 2
x x 3
z C D y 3
y z 2
OSPF
• Developed by IETF – RFC1247
• Designed for Internet TCP/IP environment
• OSPF v2 described in RFC2328/STD54
• For IPv4 only
• OSPF v3 described in RFC2740
• Mainly for IPv6
• Supports the IPv4 address family also
• Link state/Shortest Path First Technology
• Dynamic Routing
• Fast Convergence
• Route authentication
OSPF
• open”: publicly available
• uses link state algorithm
• LS packet dissemination
• topology map at each node
• route computation using Dijkstra’s algorithm
• OSPF advertisement carries one entry per neighbor
• advertisements flooded to entire AS
• carried in OSPF messages directly over IP (rather than TCP or UDP
• IS-IS routing protocol: nearly identical to OSPF
OSPF Advanced features- not RIP
• Security: all OSPF messages are authenticated (to prevent
malicious intrusion)
• Multiple same-cost paths allowed (only one path in RIP)
• Integrated uni- and multicast support:
• Multicast OSPF (MOSPF) uses same topology data base as
OSPF
• Hierarchical OSPF in large domains.
OSPF: How it works
• Hello Protocol
• Responsible for establishing and maintaining neighbor relationships
• Elects Designated Router on broadcast networks
OSPF: How it works
• Hello Protocol
• Hello Packets are sent periodically on all OSPF enabled interfaces
• Adjacencies formed between some neighbors.
• Hello Packet
• Contains information like Router Priority, Hello Interval, a list of known
neighbors, Router Dead Interval, and the network mask
• Trade Information using LSAs
• LSAs are added to the OSPF database
• LSAs are passed on to OSPF neighbors
• Each router builds an identical link state database
• SPF algorithm run on the database
• Forwarding table built from the SPF tree
OSPF: How it works
• When change occurs:
• Announce the change to all OSPF neighbors
What happens when more than one routes have the same cost?
OSPF Areas
• Group of contiguous hosts and
networks
• Per area topological database
• Invisible outside the area
• Reduction in routing traffic
• Backbone area contiguous Area 2 Area 3
• All other areas must be connected to the
backbone Area 0
Backbone Area
• Virtual Links
Area 1
Area 4
OSPF Areas
• Reduces routing traffic in area 0
• Consider subdividing network into areas
• Once area 0 is more than 30+ routers (though areas with 200+ routers in an
area are known to work fine)
• Once area 0 topology starts getting complex
• Less often today but when a group of routers is over an expensive small link
e.g vsat
• Area design often mimics typical ISP core network design
• Virtual links are used for “awkward” connectivity topologies (…) please
do not use these.
OSPF Route Types
• Intra-Area route
• All routes inside an area
• Inter-Area route
• Routes advertised from one area to
another area by an ABR
• External route
• Routes imported into OSPF from another
routing protocol by an ASBR
Exterior Gateway Protocol
• BGP (Border Gateway Protocol): the de facto inter-domain
routing protocol
• “glue that holds the Internet together”
• BGP provides each AS a means to:
• eBGP: obtain subnet reachability information from neighboring ASs.
• iBGP: propagate reachability information to all AS-internal routers.
• determine “good” routes to other networks based on reachability
information and policy.
• allows subnet to advertise its existence to rest of Internet:
“I am here”