network layer Flashcards
role of routers
examines datagram headers and decides which port to send it to
forwarding
taking the packets at one port of the router and sending it to another based on the header contents
routing
determining the path of the packet from end system to end system
what is the role of the sender in the network layer
encapsulates segments into datagrams and passes them to the link layer
what is the role of the receiver in the network layer
delivers segments to the transport layer protocol
what are the two roles of the network layer
forwarding
routing
data plane
local per router function that determines how the datagram is forwarded between ports
control plane
network wide logic that determines how the datagram is routed between source and destination hosts
what kind of service is the network layer
best effort
decentralised switching
using header field values to lookup the output port using the forwarding table and input port memory
input port queueing
if datagrams arrive faster than the forwarding rate into switch fabric
destination based forwarding
forwarding based on the ip address
generalised forwarding
forwarding based on any set of header field values
how are ip addresses stored in the lookup table
each ip is represented by prefixes instead of the entire thing
longest prefix matching
uses the longest address prefix that matches the destination address
what are the 3 types of switch fabric
memory
bus
interconnection network
what do the memory and bus switch fabric have in common
the interfaces compete with eachother for access
if one is sending data on it already then it cant be used
head of line blocking
datagram at the front of the queue prevents others in the queue from moving forward
what do we use to switch through the interconnected network
CISCO CRS router
how does the cisco crs router work
uses parallel switching planes for faster performance and scalability
8 switching planes per unit
3 stage interconnection network in each plane
supports 100+ tbps switching capacity
why do we use buffering
its required when data arrives faster than the link transmission rate
drop policy
how we choose which packets to drop when the buffer is full
switching discipline
which packets to forward and in which order
priority scheduling
drops the packet with the least priority whilst maintaining network neutrality
network neutrality
scheduling policy shouldn’t give priority in order to favour some customers as this is against international law
what are the 4 types of packet scheduling
first come first served
priority scheduling
round robin scheduling
weighted fair queueing
priority scheduling in packet scheduling
the buffer sis split int different partitions based on priority and arriving packets are classified
what is one example of what we can base priority scheduling on
how delay tolerant it is
e.g. emails are whilst videos arent
round robin scheduling
packets are arranged by priority classification in the buffer and the server sends one packet from each class cyclically
weighted fair queueing
round robin plus each class has a weight which signifies how much time to give it once its its turn
higher priority gets more time
what happens when the buffer is too small
lots of packet loss and retransmission which isn’t good for the user experience or network utilisation
what happens when the buffer is too large
long queueing delays
what is the rule of thumb for buffer size
keep the bottle neck link just full enough so its busy but not fuller
how do we calculate the buffer size
(rtt * bottleneck link capacity) / sqrt number of concurrent flows in the network
host/router interface
connection between the host/router and a physical link
how many interfaces do hosts have
1 or 2
how many interfaces do routers have
multiple
subnet
device interfaces that can physically reach each other without passing through an intervening router
how do we find the subnet
removing all devices and creating an isolated network
class a
network = 8
host = 24
class b
network = 16
host = 16
class c
network = 24
host = 8
loopback
sending packets to itself
multicast
datagrams being sent to a group of devices
classless interdomain routing
flexible division between the network and host address
no ip classes
creates masks at bit level
masks
a number that determined the network and host part of the ip
fragmentation
splitting the datagram into pieces when the mtu is reduced
where does reassembly of fragments happen
within the network but usually at the receiver side
what are the two issues with fragmentation
causes inefficient use of recourses as the same packet is being processed twice
loss of any fragment means you have to retransmit the entire datagram
dchp
dynamic host configuration protocol dynamically assigns ip addresses to hosts
how does dchp
the host broadcasts a dchp discover message (from 255.255.255.255 to 0.0.0.0)
the server responds with a proposed ip, transaction id and life time
the client broadcasts a message accepting the ip
the server sends an ack and the address
what is a life time (dchp)
the duration that the ip can be used for as its leased by the client not owned
why does the client broadcast the message accepting the proposed ip address
other dchp servers may have proposed aswell so they need to know which ip was chosen
what happens if the lease is being extended in dchp
only the last two dchp messages have to be sent
what other information may be given by the dchp server when sending the ip address
dns server name and ip
first hop router
network mask
how do networks get the subnet part of an ip address
the isp owns blocks of ip addresses that it can manage and distribute
it divides the block into smaller subnet blocks and assigns them to different organisations with each one getting a unique subnet
what are some benefits of nat
secure; hosts aren’t directly visible or accessible by any devices outside the network
can change the address of a host in the network without notifying anyone else
can change the isp without changing host addresses
only one ip needed from the isp for all devices
how does nat work
the source ip and port number on outgoing datagrams are replaced to their nat ones
incoming datagrams are switched from the nat destination ip and port number to the private one
the nat table stores each translation pair
how does Dijkstra’s link state algorithm work
starts at one note and initialises the shortest path to itself as 0 and the others as infinity
explore the neighbours and adds their costs to an array then switches to the node with the smallest cost
this is repeated until the shortest path is found creating the shortest path forwarding table
optimal substructure property
any sub portion of the path starting from the first node is also the shortest path (only positive costs)
how does the internet make sure to have scalable routing
organising the routes into regions called autonomous systems `
intra-as/intra-domain routing
handles routing within the same AS
all routers within the AS use the same intradomain routing protocol and in different AS different protocols can be used
gateway routers and AS
at the edge of the AS and connect routers in other AS and handle both intra and inter AS routing
inter-as/ intra-domain routing
manages routing between different AS
gateway routers can also do this
what are some examples of AS protocols
RID; routing information protocol
EIGRD; enhanced interior gateway routing protocol
OSPF; open shortest path first
IS-IS; OSPF with ISO standards
how does OSPF work
routers share information about the network; link state advertisement
this info is used to build a complete map of the network
using the map users can calculate the best path to send data using Dijkstra’s algorithm
how does OSPF handle security
each message is checked to make sure it hasn’t been tampered with
what are the parts of the two level hierarchy in OSPF and what is their role
local area; each router knows the exact details of its own area and each one is connected to the backbone via one or more routers
backbone; connects all the areas together and allows data to travel between them, done by the admin
what are the 4 types of routers in OSPF
local
area border
backbone
boundary
local router
work within their area and know the areas map
area border router
summarize what’s in their area and share it with the backbone
backbone router
handle communication between areas
boundary router
connect the network to other external networks
tunnelling with ip
an ipv6 datagram is carried as a payload in an ipv4 datagram when passing through ipv4 routers
whilst in the tunnel the source and destination changes to the gateway routers being used
what does the bellman-ford equation tell us
calculates the best path from a router to its destination based on the direct cost to its neighbour and the neighbours cost to reach the destination
what happens in the distance vector algorithm for each node
waits for a change in the local link cost or a message from a neighbour
recomputes the dv estimate using the dv received from the neighbour
if the dv to any destination has changed then it notifies its neighbours
what is the difference between regular dv and iterative dv
regular is at intervals whilst iterative changes as soon as it gets an update
what happens when a link cost decreases in dv
routers quickly add this info as they immediately detect a shorter path
count to infinity problem
when a link cost increases significantly routers may rely on outdated information from neighbours causing them to repeatedly increase their cost estimates for a destination leading to slow updates
what is used to solve the count to infinity problem and how does it work
poisoned reverse solution; when a router advertises its distance to a destination and it foes through a neighbour it tells that neighbour that the distance is infinity preventing it from routing back through which breaks the loop
what do all AS need
unique AS number
needs to know all destinations reachable from neighbouring AS
border gateway protocol
allows routers to advertise subnets allowing them to be reachable on the internet
eBGP
passing network reachability info between borders
iBGP
propagates reachability info to all AS internal routers (intra as)
what are the 4 bpg messages
OPEN
UPDATE
KEEPALIVE
NOTIFICATION
OPEN bpg
opens tcp connection to remote bgp peer and authenticates sending peer
UPDATE bpg
advertises a new path or withdraws an old one
KEEPALIVE bpg
keeps the connection alive in absence of updates
acknowledges OPEN requests
NOTIFICATION bpg
reports errors in the previous message
closes the connection
hot potato routing
the as routes traffic to the nearest exit within its network to hand it off to the nearest as asap minimising internal costs
tier 3 as
minor isp and customer networks
peer with other t3 providers
has customers of t1 and t2 providers
tier 2 as
national and regional isp
customers of t1providers
peer with t2 providers
tier 1 as
international isp (global back bone)
peer with each other (highly connected)
major operators
bgp session
two bpg routers(peers) exchange bpg messages over a semi permanent tcp connection advertising paths to different destination network prefixes
what does a bpg advertised route consist of
prefix and attributes
bpg prefix
destination being advertised
wither a single on or an aggregation of multiple
what are two bpg attributes and what do they do
AS-PATH; list of as that the prefix advertisement has passed through
NEXT-HOP; the ip address of the next router to reach the prefix
how does policy based routing work with bpg
when a gateway router on the as receives an ad it applies an import policy to decide whether it should accept it or which one to accept out of multiple
export policies are applied to decide whether or how it advertises routes to neighbouring as
customer client relationship
any one between a smaller and larger isp
the customer pays the provider for access to the isp
peering relationship
two domains typically of similar size agree to exchange traffic between their respective customers
the traffic flow volumes are usually similar
what happens during failures in ospf
when a router detects a failure in its path it stops forwarding packets to it and updates its routing table
however other packets are unaware of this causing transient loops where the same packet keeps getting sent back and forth between two routers
the routing algorithm eventually propagates updates to all affected routers and each one recalculates its routing table