Network Layer

5.0(1)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/68

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

69 Terms

1
New cards
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
2
New cards
what parts is the network layer made up of ?
* data plane
* control plane
3
New cards
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
4
New cards
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^^
5
New cards
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
6
New cards
where do network protocols run?
in hosts and in routers
7
New cards
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
8
New cards
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
9
New cards
what are the 2 key network layer functions?
forwarding

routing
10
New cards
what is forwarding?
forwarding is a ^^router-local action^^ which transfer packet from the r^^outer’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
11
New cards
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
12
New cards
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


1. the router examines the values of certain fields in the arriving packet header
2. uses the header values to get an index to use in the forwarding table
3. value stored at forwarding table\[index\] indicates the outgoing link interface that the router needs to forward the packet to
using forwarding tables - every router has a forwarding table

the routing algorithm determines the content of the router’s forwarding table


1. the router examines the values of certain fields in the arriving packet header
2. uses the header values to get an index to use in the forwarding table
3. value stored at forwarding table\[index\] indicates the outgoing link interface that the router needs to forward the packet to
13
New cards
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
* 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
14
New cards
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
* 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
15
New cards
what is the architecture of a router?
contains 4 components


1. input ports
2. switching fabric
3. output ports
4. routing processor
contains 4 components


1. input ports 
2. switching fabric
3. output ports
4. routing processor
16
New cards
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
17
New cards
what is the switching fabric?
where switching occurs

* connects the router’s input ports to its output ports
* completely contained in router
18
New cards
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
19
New cards
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.
20
New cards
what are routing algorithms?
used to find paths that packet needs to travel
21
New cards
what is a path?
path - sequence of routers the packet will traverse through from source to destination
22
New cards
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
23
New cards
this is a graph abstraction of a network
this is a graph abstraction of a network
24
New cards
what are the different routing algorithm classifications?
* centralised
* decentralised
* static
* dynamic
* load sensitive
* load insensitive
25
New cards
what is a centralised routing algorithm?
all routers have the complete network topology (used link state algorithms)
26
New cards
what is a decentralised routing algorithm?
routers only knows the physical connection to the neighbouring routers (uses distance vector algorithms)
27
New cards
what is a static routing algorithm?
routes change slowly over time
28
New cards
what is a dynamic routing algorithm?
can change based on what information we know (eg. traffic updates, topology changes)
29
New cards
what is a load sensitive routing algorithm?
link costs vary dynamically to reflect congestion level in underlying link
30
New cards
what is a load insensitive routing algorithm?
link cost does not reflect the past or current level of congestion
31
New cards
what are the 2 types of protocols in the network layer?
IPv4

IPv6
32
New cards
what IP stack layers do routers run?
network layer

link layer

physical layer
33
New cards
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
\
* 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
34
New cards
what is the version number field and what size is it?
for IPv4 or IPv6

4 bits
35
New cards
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
36
New cards
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\]
37
New cards
what is the datagram length field and what size is it?
header length + data length

\[16 bits\]
38
New cards
what are the identifier, flags, fragmentation offset fields used for?
contain information used for IP fragmentation and reassembly
39
New cards
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
40
New cards
what is the upper layer protocol field?
information about what the upper layer is: transport layer, TCP and UDP
41
New cards
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
42
New cards
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
43
New cards
what is the options field?
optional fields that extends the header length
44
New cards
what is the data (payload) field
transport layer segment (either TCP segment or UDP segment) or other type of data eg. ICMP message
45
New cards
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
46
New cards
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
47
New cards
what happens to the IPv4 datagram when it is passed from the network layer to the link layer?

1. the IP datagram is encapsulated within the link layer frame for transport between one router to another
2. link layer protocols can differ and use different protocols so all can’t carry the same size of network packets
3. each link layer frame has a variable: @@MTU maximum transmission unit@@ which restricts IP datagram size
4. if datagram size > MTU ⇒ fragmentation occurs
48
New cards
what is fragmentation?
breaking down payload into smaller IP datagrams called where each datagram has its own header, broken down based on the MTU
49
New cards
what are the steps of fragmentation?

1. each datagram has an ^^identification^^ number assigned by the host
2. each fragment of a datagram has the same source address, destination address and identification number as the original datagram
3. when the destination receives the fragments, it can look at the identification number to show which fragments are part of the same datagram
4. IP is unreliable and thus not guaranteed that the fragments will be sent in the same order or correctly
50
New cards
what fields are used for datagram reassembly?
flag

offset
51
New cards
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
52
New cards
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
53
New cards
this is an example of reassembly
this is an example of reassembly
54
New cards
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
55
New cards
what is an interface?
interface = the boundary between both the host/router and any one of their links
56
New cards
how are IP addresses related to an interface?
IP address related to the host/ router interface rather than the actual host/ router
57
New cards
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
58
New cards
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
59
New cards
what is a subnet?
small section of a network, formed by a network interconnecting many host interfaces and one router interface
60
New cards
what is a subnet address?
IP addressing assigns an address to a subnet
61
New cards
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
62
New cards
what are the different network classes?
Class A subnet mask /8 - Class B subnet mask /16 and Class C subnet mask /24
63
New cards
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
64
New cards
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)
subnet.X.X.0 - the .0 means that you want to access all the interfaces on that subnet (network)
65
New cards
what is the internet’s address assignment strategy?
Classless Interdomain Routing CIDR \[RFC 4632\]
66
New cards
what is CIDR?
ip addressing format - 32 bits etc.

using /xx for the subnet mask

range of IP addresses with common prefixes
ip addressing format - 32 bits etc. 

using /xx for the subnet mask 

range of IP addresses with common prefixes
67
New cards
what is IPv6?
a new type of IP addressing with extended addressing capabilities needed as 32 bit IPv4 address space is being used up
68
New cards
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
69
New cards
what is the format of an IPv6 datagram?
knowt flashcard image