what is the purpose of the network layer?
provides logical communication between hosts (not processes running on host) and doesn’t know the actual process being sent as that is responsible by transport layer
what parts is the network layer made up of ?
data plane
control plane
what is the data plane?
contains the forwarding function:
multiple per-router functions in network layer that determine how a datagram arriving at one router’s input link is forwarded to the router’s output link
functions include -
forwarding packets
blocking packets from exiting a router (eg. malicious host or to a forbidden destination host)
duplicating packets and sending them over multiple outgoing links
what is the control plane?
contains the routing protocol:
protocols that include network-wide logic that controls how data is routed amongst routes along an end-to-end path (from source to destination host) using routing algorithms
what are the 2 types of networking?
traditional - data plane forwarding function and control plane routing protocol are implemented together within a router
software-defined networking (SDN) - separates data plane and control plane. data plane in router and control plane in a separate service, eg. remote controller
where do network protocols run?
in hosts and in routers
what happens in the network layer on the sending side?
sending side ⇒ encapsulates segments from transport layer into datagrams (with network header) and sends to router
what happens in the network layer on the receiving side?
receiving side ⇒ receive datagram from nearest router, extract transport layer segment (by unwrapping the network datagram and removing network header) and sends segment to transport layer
what are the 2 key network layer functions?
forwarding
routing
what is forwarding?
forwarding is a router-local action which transfer packet from the router’s input link interface to its output link interface - takes nanoseconds and is implemented in hardware
actually moving the packet
eg. packet arriving at a nearby router needs to be forwarded to the next router on the path
what is routing?
routing is a network-wide process to determine end-to-end path that a packet takes - takes seconds and is implemented in software
network layer defines the route for the packet to take to arrive at the destination host
uses routing algorithms to define the best route (shortest, least cost etc.) and sends the forwarding information to the router
how does a router forward a packet?
using forwarding tables - every router has a forwarding table
the routing algorithm determines the content of the router’s forwarding table
the router examines the values of certain fields in the arriving packet header
uses the header values to get an index to use in the forwarding table
value stored at forwarding table[index] indicates the outgoing link interface that the router needs to forward the packet to
how are forwarding tables configured in the traditional network approach?
the routing algorithm is in every router and runs to find the best route
router contains forwarding and routing functions
routing algorithm functions in one router communicate with the routing algorithms in another to compute the values for forwarding table
the different algorithms in each router communicate by exchanging routing messages with routing information that follow a routing protocol
how are forwarding tables configured in the SND approach?
routing algorithm implemented centrally, remotely in a remote controller (eg. implemented as a data centre with high reliability + redundancy, managed by ISP or third party)
the remote controller distributes the forwarding table to every router
routing device (router) only does forwarding, remote controller computes and distributes the table
routers and remote controller communicate by exchanging messages containing the forwarding tables and other routing info
what is the architecture of a router?
contains 4 components
input ports
switching fabric
output ports
routing processor
what are input ports?
to receive packets
performs physical layer function - terminates incoming physical link at a router
performs link layer function - gets packet from link layer and transports it to network layer, interoperate with link layer at other side of incoming link
performs the lookup function on the forwarding table to determine the router output port that the packet needs to be forwarded to
control packets are forwarded from the input port to the routing processor
the number of ports supported by the router can vary
what is the switching fabric?
where switching occurs
connects the router’s input ports to its output ports
completely contained in router
what are output ports?
to send packets
stores packets received from switching fabric
transits packets on the outgoing link by performing link layer + physical layer functions
what is the routing processor?
performs control plane functions (routing) and network management functions
traditional routers - executes routing protocols, maintains routing tables and attached link state information, computes the forwarding table for that router
SDN routers - communicates with the remote controller to receive forwarding table entries computed by the remote controller and installs these entries in the router’s input ports.
what are routing algorithms?
used to find paths that packet needs to travel
what is a path?
path - sequence of routers the packet will traverse through from source to destination
how can we determine a good path?
good path = least cost, fastest, least congested
shortest
fastest
but the shortest and fastest path might not be the same
this is a graph abstraction of a network
what are the different routing algorithm classifications?
centralised
decentralised
static
dynamic
load sensitive
load insensitive
what is a centralised routing algorithm?
all routers have the complete network topology (used link state algorithms)
what is a decentralised routing algorithm?
routers only knows the physical connection to the neighbouring routers (uses distance vector algorithms)
what is a static routing algorithm?
routes change slowly over time
what is a dynamic routing algorithm?
can change based on what information we know (eg. traffic updates, topology changes)
what is a load sensitive routing algorithm?
link costs vary dynamically to reflect congestion level in underlying link
what is a load insensitive routing algorithm?
link cost does not reflect the past or current level of congestion
what are the 2 types of protocols in the network layer?
IPv4
IPv6
what IP stack layers do routers run?
network layer
link layer
physical layer
what is the IPv4 datagram format?
header length
length
header checksum
options
data/ payload
source IP
destination IP
version number
type of service
identifier
flags
fragmentation offset
time to live
upper layer
datagram = segment + network header
5-2-7
what is the version number field and what size is it?
for IPv4 or IPv6
4 bits
what is the header length field and what size is it?
same as SEGMENT: header can vary in length because of optional fields, typical header length is 20 bytes
4 bits
what is the type of service field and what size is it?
distinguish between different types of IP datagrams and request services (real time, non-real time/ priority, high throughput)
[8 bits]
what is the datagram length field and what size is it?
header length + data length
[16 bits]
what are the identifier, flags, fragmentation offset fields used for?
contain information used for IP fragmentation and reassembly
what is the time to live field?
ensures datagram doesn’t live forever as there could could be errors, deadlock that causes processing time. each time datagram is processed by router TTL--, when TTL = 0, router drops datagram
what is the upper layer protocol field?
information about what the upper layer is: transport layer, TCP and UDP
what is the header checksum field?
electronic components can cause bit corruption and routers discard datagrams with detected errors. checksum must be recomputed and stored at each router since TTL + other fields can change
what are the source + destination IP address fields?
when a source creates a datagram, it inserts its IP address into the source IP address field and inserts the address of the ultimate destination into the destination IP address field
what is the options field?
optional fields that extends the header length
what is the data (payload) field
transport layer segment (either TCP segment or UDP segment) or other type of data eg. ICMP message
what is the average length of a datagram?
20 bytes of datagram header
payload { 20 byes of transport layer header, application layer message }
in total- 40 bytes of header and an application layer message of variable length
why is it important to know the length of a datagram?
need to know length of datagram because it needs to be transmitted through a link and the link layer frame can have size restraints
what happens to the IPv4 datagram when it is passed from the network layer to the link layer?
the IP datagram is encapsulated within the link layer frame for transport between one router to another
link layer protocols can differ and use different protocols so all can’t carry the same size of network packets
each link layer frame has a variable: MTU maximum transmission unit which restricts IP datagram size
if datagram size > MTU ⇒ fragmentation occurs
what is fragmentation?
breaking down payload into smaller IP datagrams called where each datagram has its own header, broken down based on the MTU
what are the steps of fragmentation?
each datagram has an identification number assigned by the host
each fragment of a datagram has the same source address, destination address and identification number as the original datagram
when the destination receives the fragments, it can look at the identification number to show which fragments are part of the same datagram
IP is unreliable and thus not guaranteed that the fragments will be sent in the same order or correctly
what fields are used for datagram reassembly?
flag
offset
how is the flag field used?
each fragment will have a flag bit - destination hosts needs to ensure that all fragments that make up a full datagram have been received
all fragments have flag bit = 1
the last fragment has flag bit = 0
how is the offset field used?
each fragment has an offset variable - offset specifies where there fragment fits in the original datagram so that the destination host can reassemble in the correct order + determine any missing fragments
starts at 0 and is split into 8 byte blocks
this is an example of reassembly
what is IPv4 addressing and why is it needed?
host has normally 1 link to the network
router has 2 or more links to the network
every host/ router can send/ receive IP datagrams so each interface needs to have an IP address
what is an interface?
interface = the boundary between both the host/router and any one of their links
how are IP addresses related to an interface?
IP address related to the host/ router interface rather than the actual host/ router
how are IP addresses formatted?
32 bits long
dotted decimal notation - each byte of the address is written in decimal form separated with a dot
cannot be chosen randomly
what sections make up this IP address? 223.1.1.0/24
subnet.subnet.subnet.host/subnetmask
part of the IP address shows what subnet it is connected to
what is a subnet?
small section of a network, formed by a network interconnecting many host interfaces and one router interface
what is a subnet address?
IP addressing assigns an address to a subnet
what is a subnet mask?
/XX indicated that the leftmost XX bits of the total 32 bits define the subnet address
eg. /24 is the submnet mask - 24 left-most bits belong to the network
there are different network classes based on what subnet mask are used
what are the different network classes?
Class A subnet mask /8 - Class B subnet mask /16 and Class C subnet mask /24
what is the difference between an /8 subnet and an /24 subnet?
/8 subnet vs. /24 subnet - 8 bits used, so the rest of the bits can be used to specify the hosts - so more IP addresses available, a bigger network that a /24 subnet
this is an example of how IP addresses make up a subnet
subnet.X.X.0 - the .0 means that you want to access all the interfaces on that subnet (network)
what is the internet’s address assignment strategy?
Classless Interdomain Routing CIDR [RFC 4632]
what is CIDR?
ip addressing format - 32 bits etc.
using /xx for the subnet mask
range of IP addresses with common prefixes
what is IPv6?
a new type of IP addressing with extended addressing capabilities needed as 32 bit IPv4 address space is being used up
what is the difference between IPv6 addresses and IPv4?
expanded addressing capabilities
128 bits long - ensures we won’t run out of ip addresses,
unicast, multicast and new types of addresses (anycast address) that allows datagram to be delivered to an one of a group of hosts
fixed 40 byte header
the header has no optional fields that are in IPv4
faster processing of datagram by router
what is the format of an IPv6 datagram?