IK2218 - Network Layer

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/85

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 4:31 PM on 10/11/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

86 Terms

1
New cards

Internetwork

Network of networks

2
New cards

Subnets

Link layer networks. Connected by routers via an interface, one per subnet. The network layer protocol(s) understood by every host and router.

3
New cards

Network Layer Purpose

End-to-end delivery of packets independent of the underlying link layer technologies

4
New cards

Network Layer Service Abstractions

Properties of end-to-end delivery. Ex. lossless transmission, bounded delay, guaranteed bandwidth, in-order delivery, connection-oriented vs connectionless.

5
New cards

Lossless Transmission

Packets sent will be recieved as they were sent

6
New cards

Bounded Delay

Packets sent will be recieved bounded by some time constant, ex. 15 ms.

7
New cards

Guaranteed Bandwidth

Ex. if A sends at most 2 MBit/s it will go through flawlessly

8
New cards

In-Order Delivery

Data arrives in the order it was sent.

9
New cards

Connection-oriented Service

Also called Virtual Circuit Switched. Source has to establish a connection to destination and send packets along the connection. Packets carry a VC identifier. Afterwards source has to tear-down connection. All packets follow the same path. Routers/Switches are statefu, will have to remember connection. Resources can easily be allocated to VC

10
New cards

Connectionless Service

Also called datagram service. No connection establishment. Packets are routed individually based on some info, ex. destination host address, this is what the internet uses. Route lookup for each packet, packets may not travel together. Routers are stateless but resource allocation can be challenging

11
New cards

End-to-End Delivery Types

Two types, direct and indirect delivery.

12
New cards

Direct Delivery

Direct delivery is when source and destination are connected to the same physical network, so destination address is in a network connected to a local interface.

13
New cards

Indirect Delivery

From host to router or router to router. Destination address is not within a network connected to a local interface.

14
New cards

Forwarding - Source Routing

Source makes routing decision & packet carries a path (ex. the hops). Downside is topology must be known, hard in huge internetworks and it needs space in the packet.

15
New cards

Forwarding - Next Hop Routing

One version is virtual circuit ID based, ex MPLS. Packet carries VC identifier which can change at each hop. There is a [VCID, nexthop] table so ex. if VCID says 3 send to router R2 and maybe update 3 to 4. Needs connection establishment to populate tables.

16
New cards

Forwarding - Address Based

Used in IPv4 & IPv6. Packet carries a destination address, ex. IPv4 address. Then look in a [addr, nexthop] table to find where to send packet. Can aggregate entries to save space, so instead of entry for each network can have one for combined. This does require an addressing scheme that allows aggregating subnets to a bigger subnet. Another possible thing is use a default entry.

17
New cards

ID/Name

Answers the question “what”. Doesnt change when moving, may not be unique but identifies what it is.

18
New cards

Address / Locator

Answers where? Can change while moving

19
New cards

Route

Answers how, how do we get to an address? Depends on the current location

20
New cards

Multi-homing

Entity with one ID but multiple addresses, ex. in multiple subnets

21
New cards

Mobility

Entity with one ID with changing addresses.

22
New cards

Unicast

One-to-one

23
New cards

Broadcast

One-to-All. Send to all destinations ex. in a subnet

24
New cards

Multicast

One to many. Send to all members of a group

25
New cards

Anycast

One-to-any. Deliver data to at least one member of a group

26
New cards

IPv4 Logical Address

32-bits assigned to an interface. Either binary notation but more commonly dotted decimal. Divide 32 bits into 4 1-byte blocks and separate by dots, ex. all 1’s is 255.255.255.255. They have a hierarchy - prefix is netID then suffix hostID

27
New cards

Classful IPv4 Addressing

Address space partitioned into 5 classes. A-C unicast, D multicast and E reserved. Class determined length of netID and hostID. Not used today. Class A was 0.0.0.0/1, Class B 128.0.0.0/2, Class C 192.0.0.0/3, Class D 224.0.0.0/4, Class E 240.0.0.0/4

28
New cards

Classless IPv4 Addressing (CIDR)

CIDR = Classless Inter Domain Routing. Notation is address followed by prefix length, or netmask. Ex. 0.0.0.0/4, where 4 is length of netID. Unicast addresses start with 0-223, multicast 224-239, 240-255 are experimental / reserved.

29
New cards

Network Mask

In IPv4 they are 32 bit long where prefix length determines how many 1’s there are. Ex /24 => first 24 are 1’s, rest 0. Used to compute net & hostID and broadcast address.

30
New cards

Compute net, host, broadcast ID

& = bit-wise AND, | = bit-wise OR

  • Address & Mask = netID

  • Address & Inverted Mask = hostID

  • Address | Inverse Mask = broadcast addr


31
New cards

IPv6 Logical Address

128-bits assigned to an interface, can be more than 1 per interface. Uses colon hexadecimal notation. Ex. 2000:1000:…. Common ways to shorten is omit leading 0’s or zero compression, one of the series of zeros replaced by ::. Typically first 64-bits is global routing prefix and last 64 is interface ID.

32
New cards

IPv6 Global Unicast Address

Prefix is 001 in binary. Then 64 bits network ID and 64 bits interface ID. Either interface ID uses 48-bit MAC but for security reasons mostly random numbers.

33
New cards

Private / Unique Local Addresses

Not globally unique. Two uses, either on isolated networks or behind a NAT. In IPv4 there are three blocks.

10.0.0.0/8, 172.16/12, 192.168/16. In IPv6 its FC00::/7.

34
New cards

Link-local Addresses

Used for link local unicast when you dont have an address yet. Routers do not forward packets with such a destination. Reserved prefixes in IPv4 is 169.254.0.0/16, in IPv6 FE80::/64. Can either be random with duplication detection or MAC derived (IPv6 only)

35
New cards

Multicast Addresses

Reserved addresses registered by IANA. 224.0.0.0/24. All hosts on subnet = 224.0.0.1, all routers on subnet = 224.0.0.2, OSPF all routers = 224.0.0.5…

36
New cards

Global IP address allocation

IANA manages public IP addresses & ASN:s. IANA allocates blocks to Regional Internet Registreies (RIR), one on each continent. RIR allocates blocks to National / Local Internet Registreies (LIR), which are mostly ISP like telia. Finally LIR assigns blocks to end users.

37
New cards

IPv4 Address Exhaustion

Last IPv4 block assigned by IANA 2011. Solution more efficient use of IPv4 addresses. Example 80% assignment rule - if can’t use 80% of allocated has to return to layer above. Also address block trading and NAT’s with local networks and transition to IPv6

38
New cards

How to allocate blocks

2^(32-n) addresses in a block, where n is /n. 2 are always reserved for NW address and DBA (except /31). Therefore always +2 number of interfaces and think about grouping up similar size blocks for aggregation.

39
New cards

Sequential Allocation

Allocate blocks sequentially. Doesn’t allow for easy expansion at previous allocated blocks.

40
New cards

Spread-Out Allocation

Leave space after to allow expansion.

41
New cards

Longest Prefix Matching

If multiple entries match while forwarding, choose the one with longest prefix matching.

42
New cards

Forwarding Table Fields

  • Mask: Netmask applied for entry

  • Network Address: Destination network

  • Next Hop Address: address for next router interface

  • Interface: Outgoing interface [ex. eth0]

  • Flags: Status / info. U(p) = Next hop router running, G(ateway): shows indirect delivery, H(ost-specific) = entry specific for a host, /32

  • Reference Count: # of users using this route

  • Use: # of packets transmitted for this destination. Used for ECMP


43
New cards

Fast Lookup Trie

Use binary trie for fast lookup. Store [nexthop, interface] in each node and travel as far down as possible.

44
New cards

IP Service

IP is a best effort service - Connectionless & unreliable. App/Trans layer handles reliability. Implements only the absolutely necessary functionality.

45
New cards

Network Layer functionality

  • Addressing (globally unique addresses, aggregation)

  • Forwarding

  • Fragmentation

  • Multiplexing/Demultiplexing

  • Routing Protocols

  • Error handling and diagnosis


46
New cards

Header length (IPv4)

4 bit field. Size of IPv4 header including options (20-60 bytes). Granularity is 4 bytes, 5<=HLEN<=15.

47
New cards

Total Length (IPv4)

16 bit field. Total length of the datagram, including header. 1 byte granularity. If datagram fragmented, its the length of the fragment

48
New cards

Payload Length (IPv6)

16 bits. Total length of the payload, excluding header which is fixedsize of 40 bytes. Length of fragment if fragmented with 1 byte granularity. Extension header allows for Jumbo payload up to 4 GB.

49
New cards

Protocol Type Field (IPv4) / Next Header (IPv6)

8 bit. Specifies what type of protocol from which the data was recieved from which is what the destination has to send. Assigned by IANA. Ex 1 = ICMP, 4 = IPv4, 6 = TCP, 7 = UDP, 41 = IPv6

50
New cards

Maximum Transfer Unit (MTU)

The maximum payload size of a link, ex. 1500 bytes in ethernet. Specifies the largest IP datagram size that can be carried, ex. 1500 MTU = 20 bytes IPv4 header, 1480 IPv4 payload.

51
New cards

Fragmentation (IPv4)

Hosts and routers can fragment, unless DF bit set. Fragments are routed independently, destination host reassembles. If fragment is lost - discard the entire datagram. Minimum link MTU is 68 bytes. Fragmentation data is stored in IPv4 header.

52
New cards

Fragmentation (IPv6)

Only hosts fragment. Router discards packet if they can’t send and notifies the sender (also includes MTU of part that failed). Fragments routed independently and destination host reassembles and discard all if a fragment is lost. Minimum MTU is 1280 bytes and information stored in Fragmentation extension header.

53
New cards

Fragmentation Field (IPv4)

Contains identification, Flags, Fragmentation Offset

  • Identification: 16 bits. Datagram uniquely identified by src and dst IP, ID and protocol. ID is copied to all frags of a datagram.

  • Flags: 3 bits for 3 flags. 1 is Reserved Field (RF) - for future use. 1 Dont Fragment (DF) - datagram should not be fragmented. Send error to sender if can’t forward. 1 More Fragments (MF) - 1 for all frags except last

  • Fragmentation Offset: 13 bits. Shows relative position of a fragment with respect to whole datagram. 8-byte granularity. So if value is 3, offset is 24 bytes.


54
New cards

Infinite Loop Avoidance

Limit lifetime of every datagram. Maintain down counter in packet header, initially 64 by default. Router drops packet if counter <= 1. Decrements the counter and forwards packet otherwise. Notifies sender if package expires, called Time To Live (TTL) in IPv4, every router should decrement the TTL by the number of seconds holding the datagram. Called Hop Limit in IPv6, both are 8 bits.

55
New cards

Error Checking (IPv4)

Detect bit errors in IPv4 header only. Calculate on each hop using the Internet Checksum Algorithm

56
New cards

Internet Checksum Algorithm

Take IP header, convert to sequence of 16-bit words and add together using one’s complement. The one’s complement of the result is stored in the checksum field. Drop the packet if the sum is not 0. IPv6 has no checksum.

57
New cards

Quality of Service

Network is used by apps with different requirements. Therefore, create preferential tratment for more sensitive data. Specified in Service type field (TOS byte)

58
New cards

TOS Byte (Old version)

Specify QOS on a per-packet basis. Bits 0-2 are used for Precedence which defines priority, ex. when packets must be dropped. Bits 3-6 are TOS bits. Bit 3 = Normal / Low delay, Bit 4 = Normal / High Throughput, Bit 5 = Normal / High Reliability, Bit 6 = Normal / Minimize cost.

59
New cards

DSField

Bits 0-5 are Differentiated Servides CodePoint(DSCP). A way to define treatment of packets. Ex. default forwarding is all 0’s, normal best effort service.

60
New cards

Explicit Congestion Notification (ECN)+

2 bits in Service field. Allows to signal congestion. Four values, 00 = packet does not support ECN, 01 or 10 = packet supports ECN. If experience congestion, then set to 11 and reciever can send to sender that there is congestion and sender can slow the rate of sending.

61
New cards

IPv4 Header

VER 4 bits, HLEN 4 bits, Service 8 bits, Total Length 16 bits, ID 16 bits, flags 3 bits, frag offset 13 bits, TTL 8 bits, protocol 8 bits, header checksum 16 bits, Source IP, Destination IP, Options.

62
New cards

Network Interface Card (NIC)

Has MAC address, IP address and configured name.

63
New cards

Finding MAC address

Either static hardcoded mapping between MAC & IP, or dyanmic with either Address Resolution Protocol (ARP) or Neighbor Discovery for IPv6.

64
New cards

ARP Operation

  1. Send ARP request on broadcast to all stations “who has x.x.x.x”, tell “y.y.y.y”

  2. Destination recognizes their IP and sends unicast ARP reply to sender “I have y.y.y.y and my mac is …”

If there is ARP cache can check that before the request, also check forwarding table before checking the ARP cache.

65
New cards

ARP Packet

HW type, Protocol type, Hardware length, Protocol Length, Operation (req, reply), Sender MAC, sender IP, dst MAC, dest IP.

66
New cards

ARP Cache

Used to optimize ARP. Save resolved addresess in cache, should time out after some time.

67
New cards

ARP Snooping

Learn mappings from broadcast ARP traffic. Recievers can update their cache with sender mapping before processing the request.

68
New cards

ARP Timeout

One use is when there is no reply to ARP request. Retry a number number of times. Then there are also cache timeouts to remove entries after some time, ex. 10-15 minutes.

69
New cards

ARP Proxy

Respond to ARP requests on someone elses behalf. Allows sub-networks to be hidden.

70
New cards

Gratuitos ARP

Hosts can send an ARP request of their own address. This informs others of its mapping so they can update their cache without ARP request/reply. Used for failsafe servers, if primary goes down backup can send gratuitous ARP with primary IP & backup MAC. Abusing this is ARP Poisoning

71
New cards

IP Diagnosis & Control

Purpose is control, testing and debugging of network functionality. Implemented as variable size options, extensions after fixed header. In IPv4, max 40 bytes. They start immediately after header. All IP implementations must recognize these, unknown options ignored.

72
New cards

IPv4 Options Encoding

Two types, single and multi-byte. First the code byte has 1 bit if options should be copied to fragments. Then 2 bits for what class of option it is and then 5 bits for actual option number. Then the length byte is total length of this option & data field option specific.

73
New cards

Source Route - Options

Strict Source Routing (SSRR). This option specifies exact path datagram will go through via IP addresses. Loose Source Routing (LSRR), this path goes through all addresses but there can be additional ones not listed. Sender prefills routers ot be visited, routers put their address in option. Used to troubleshoot, map network, performance and hacking.

74
New cards

IPv6 Extension Headers

Chain of extension headers after IPv6 header. Order specified, occurs at most once. Extension header length is multiple of 8 octets.

75
New cards

IPv6 Hop-by-hop options header

Information to be passed to all routers on the path, must immediately follow IPv6 header. Can carry a number of options of different times. Ex. Jumbo Payload or Router alert option - datagram needs special attention from router.

76
New cards

Internet Control Message Protocol (ICMP)

Signaling protocol for IP to report problems back to sender and used for control & management. Considered a part of IP, but uses IP for delivery.

77
New cards

ICMP Fields

Type 8 bits - what type of message, ex. dst unreachable

Code 8 bits - Reason why, ex. host unreachable

Checksum 16 bits. Covers header and data.

78
New cards

ICMP Message Types

Error Reporting & Query/Informational messages

79
New cards

ICMP Error Reporting Messages

Reports errors but doesnt correct them. Error message is always send back to original sender based on source IP. Error message carries part of datagram header/data to allow sender to know which datagram generated error. Not sent under certain conditions, ex. error message or error message, broadcast / multicast message, IP fragment other than the first, source not specified.

80
New cards

ICMP Time Exceeded

Sent if TTL = 0, send code 0 or if all fragments dont arrive within a time limit at destination started when the first one arrived, code 1.

81
New cards

Traceroute

Tool using ICMP. Traces path to destination by exploring each IP hop on the way. Set small TTL fields and recieve time exceeded incrementally. When final host reached, use unlikely UDP port and get ICMP port unreachable back.

82
New cards

ICMPv6 Packet Too Big

Router recieves datagram larger than MTU. Discards datagram and sends message to source including MTU. Can be used to find a paths MTU, like ICMPv4 Destination Unreachable (Fragmentation Needed)

83
New cards

ICMP Error Reporting Header

Carries part of original IP datagram. For ICMPv4, its the original header + options and 8 bytes of payload. ICMPv6 its header + payload such that the size is <= min IPv6 MTU.

84
New cards

ICMP Echo Request & Reply

Purpose is checking host reachability. Send a request and then destination answers with reply to show its reachable

85
New cards

Ping

Tool to test host reachability. Does this by sending ICMP echo request to node, then server replies with ICMP echo reply. With IPv4 recourd route option, the route of ping can be traced (up to IHL limit).

86
New cards

IPv6 Neighbor Discovery Protocol

Purpose is to assist forwarding of datagrams. Does this by doing address resolutions (ARP in IPv4), Forwarding table updates (Redirect in ICMPv4) and router address. Like ARP with different names. Query = Neighbor Solicitation,Reply = Neighbor Advertisement, Redirect = Forward table update necessary and there is also Router solicitation / advertisement for SLAAC.