Docsity
Docsity

Prepara i tuoi esami
Prepara i tuoi esami

Studia grazie alle numerose risorse presenti su Docsity


Ottieni i punti per scaricare
Ottieni i punti per scaricare

Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium


Guide e consigli
Guide e consigli


Computer Network Technologies and Services - PoliTO, Appunti di Reti informatiche

Complete file with all the theory covered in class, including everything the professor said. All exam topics are included: IPv4, IPv6, wireless and cellular networks, modern lan design and operation, QoS, routing, VPN, Optical Internet, MPLS, CDN, Pattern Analysis

Tipologia: Appunti

2025/2026

In vendita dal 09/03/2026

monica-del-sorbo
monica-del-sorbo 🇮🇹

4.6

(9)

51 documenti

1 / 197

Toggle sidebar

Questa pagina non è visibile nell’anteprima

Non perderti parti importanti!

bg1
1
Computer Network Technologies and
Services
IPV4 ADDRESSING AND ROUTING ............................................................................................................................ 1
IP-SPECIAL ADDRESSES ......................................................................................................................................................... 1
IP-ADDRESSING CLASSES ....................................................................................................................................................... 2
IP ADDRESSING: CIDR .......................................................................................................................................................... 2
IP ROUTING ........................................................................................................................................................................ 3
IPV4 MULTICAST ................................................................................................................................................................. 5
IPV6 ........................................................................................................................................................................ 7
MOTIVATION AND HISTORY ................................................................................................................................................... 7
IPV6 ADDRESSES ............................................................................................................................................................... 12
IPV6 ADDRESS TYPES ......................................................................................................................................................... 14
IPV6 MODIFIED PROTOCOLS ................................................................................................................................................ 18
PACKET HEADER FORMAT ................................................................................................................................................... 18
INTERFACING WITH LOWER LAYER ........................................................................................................................................ 20
NEIGHBOR DISCOVERY AND ADDRESS RESOLUTION .................................................................................................................. 21
ICMPV6 ......................................................................................................................................................................... 22
DEVICE CONFIGURATION IN IPV6 ......................................................................................................................................... 25
IPV4 TO IPV6 TRANSITION...................................................................................................................................... 30
DUAL STACK APPROACH ..................................................................................................................................................... 32
TUNNELING SOLUTIONS ...................................................................................................................................................... 32
SCALABLE, CARRIER-GRADE SOLUTIONS ................................................................................................................................. 35
WIRELESS AND CELLULAR NETWORKS .................................................................................................................... 43
ELEMENTS OF A WIRELESS NETWORK ..................................................................................................................................... 43
WIRELESS LINKS CHARACTERISTICS ....................................................................................................................................... 44
CELLULAR NETWORK .......................................................................................................................................................... 47
CHANNEL ACCESS .............................................................................................................................................................. 47
FREQUENCY REUSE............................................................................................................................................................. 48
FREQUENCY ALLOCATION .................................................................................................................................................... 52
NETWORK ARCHITECTURE ................................................................................................................................................... 52
CELLULAR NETWORK EVOLUTION .......................................................................................................................................... 54
GSM: THE 2ND GENERATION .............................................................................................................................................. 56
LTE: THE 4TH GENERATION ................................................................................................................................................. 62
LTE DATA PLANE/CONTROL PLANE ...................................................................................................................................... 67
MOBILITY ........................................................................................................................................................................ 70
5G NETWORKS ................................................................................................................................................................. 75
WIRELESS LANS ................................................................................................................................................................ 79
PRINCIPLES OF MODERN LAN DESIGN AND OPERATION ......................................................................................... 86
HISTORY .......................................................................................................................................................................... 86
REPEATER ........................................................................................................................................................................ 86
MULTIPORT REPEATERS: HUBS ............................................................................................................................................. 87
BRIDGES .......................................................................................................................................................................... 87
COLLISION AND BROADCAST DOMAINS ................................................................................................................................... 88
HALF AND FULL DUPLEX MODE ............................................................................................................................................. 89
FULL DUPLEX AND SWITCHES ................................................................................................................................................ 90
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Anteprima parziale del testo

Scarica Computer Network Technologies and Services - PoliTO e più Appunti in PDF di Reti informatiche solo su Docsity!

Computer Network Technologies and

IPv4 addressing and routing

Interface: part of device which is capable to connect to the network. One or more IP addresses can be assigned to the same interface (depends from whether the network is subdivided into many subnetworks or not); IP address: IP addresses are represented with the dotted decimal notation. The first part of the address identifies the network (network ID). The last part identifies the specific interface in that network instead (host ID). Switches and access points are layer-2 devices and do not have an IP address; → it identifies routers and hosts A host can have multiple interfaces, but only one is active at a time. A router (layer 3 device) has multiple interfaces, and each interface has its own IP address. Subnetwork: portion of the network characterized by interfaces which have the same high order bits (the same network ID) and share the same physical layer. The network ID has some “random” high orderbits (either 1 or 0) and only 0s in the lower part of its address. In the middle, we have a router (a layer 3 device), and on the left, there is a switch (a layer 2 device). The blue area represents a subnet, which is a layer 3 construct that allows grouping together interfaces that share something in common: the network ID. They are grouped together through a switch. A subnet is a logical construct. On the right, there is a Wi-Fi access point, which acts as an aggregator. Here, we have another subnet, different from the previous one.

  • Network part: the high-order bits of the IP address
  • Host part: the low-order bits of the IP address In the image, the IP addresses are represented in octet notation (dotted decimal form). 32 bit addresses divided into four part with 8 bit each. An IP network is defined as the set of IP devices whose interfaces:
  • Have the same network part of the IP address (there are some exceptions)
  • Are connected to the same physical (link-layer) network Example: 100110011 …011 … …0111 → 155.73.45.

IP-special addresses

There are some special addresses that are never assigned to host/router interface: When all the host bits (the end part of the address) are set to 0s, the address represents the subnet itself. The address 255.255.255.255 is the limited broadcast address. If a packet has this as its destination address, it is delivered to all hosts on the same physical network. At layer 2, the hosts recognize this special address and perform a broadcast to all other hosts connected to the same router. It is called limited broadcast because it is stopped at the router—it does not go beyond that network. Example an host has as destination address 223.1.2.255. The effect is as follows: the packet is sent from the host, then the switch forwards it directly to the router. The router looks up the network ID in its routing table and determines the correct interface where the packet should be sent. Within that subnet, it acts as a limited broadcast, so the packet is delivered to all hosts in that network.

Example: 127.0.0.1. This address is never sent to a network. Instead, it is returned to the same host, where the IP layer immediately recognizes it. It is usually used to check if a local service (e.g., a web server) is working correctly.

IP-addressing classes

In the early days of the Internet, IPv4 addresses were allocated using classful addressing: Class A → very few networks, each with millions of hosts Class B → more networks, each with about 65k hosts Class C → many networks, each with up to 254 hosts This rigid division into fixed blocks soon became inefficient. A typical organization didn’t need 16 million host (Class A), nor was 254 (Class C) enough. They often requested a Class B, which gave 65k addresses, but maybe only used 5k → the rest was wasted. This waste accelerated the depletion of IPv4 addresses. Many networks were underutilized, but the addresses were still consumed.

IP addressing: CIDR

It no longer relies just on the IP address to distinguish the network ID from the host ID. There’s an extra piece of information: the netmask. All IP addresses now come with a prefix length shown within the IP addresses themselves in the format “/x” at the end of each address (where x is a decimal number). When we want to write the netmask associated with the address shown in the figure, the procedure is as follows. We set all the bits in the network part to 1 and all the bits in the host part to 0. Then, we notice that the network part ends after 23 bits. Of course, it’s not necessary to write the addresses in binary; it’s enough to use dotted decimal notation. For example: 200.23.16.0/23 → This is a valid network ID, since there are 9 zeros in the host part. Since the IP address contains more than 9 zeros, we could also define another, larger netmask that is still valid. For instance: 200.23.16.0/20 → This is also a valid network ID. However, if the address 200.23.16.0/23 has already been allocated, then 200.23.16.0/20 cannot be allocated, because this would create overlapping address spaces. The netmask is a string of bits which has all 1s for the network ID part and all 0s for the host ID part. The netmask can be “built” with a sequence of x-ones followed by as many zeros as needed to reach the 32-bits length of the IP address. Performing a logical bitwise AND operation between the netmask and the IP address returns the network ID as result. Example Let’s consider the following IP address: 196.64.8.2/ As we can see, we have x = 16. That means the netmask of this IP address has the first 16 bits equal to 1 and the others equal to 0. With the dotted decimal representation, we obtain: 255.255.0. Netmask: 11111111 11111111 00000000 00000000 Let’s now convert our IP address from the dotted decimal representation to its binary representation. IP address: 11000100 01000000 00001000 00000010

match between the destination IP address and the result of the bitwise AND operation between the netmask and the incoming datagram address. Let’s do that: In other words, if the result is equal to the destination IP, a match has been found! The length of that match is equal to the length of the applied netmask. In our case we have a 16 bits long match (that means the first 16 bits of the datagram IP address are equal to the first 16 bits of the destination IP address). Let’s consider another example with the same routing table as before. This time, the incoming datagram has the following IP address: 200.23.17.53; We obtain: This time we have 2 matches! So, we choose the longest match (the 2nd one, because 23 > 20). So, the datagram will be forwarded through the interface (output link) 2. Two hosts can communicate directly (without a router) only if both consider each other inside the same subnet, based on their IP address and subnet mask. Examples:

  • Case 1 : o Host A: 130.192.1.1/25 (mask 255.255.255.128) o Host B: 130.192.1.129/24 (mask 255.255.255.0) o Host A’s subnet: 130.192.1.0 – 130.192.1. o Host B’s subnet: 130.192.1.0 – 130.192.1. Result: o Host A sees Host B outside its subnet → needs a router to reach B o Host B sees Host A inside its subnet → tries direct communication
  • Case 2 : o Host A: 192.168.1.1/24 (mask 255.255.255.0) o Host B: 192.168.1.129/25 (mask 255.255.255.128) o Host A’s subnet: 192.168.1.0 – 192.168.1. o Host B’s subnet: 192.168.1.128 – 192.168.1. Result: o Host A sees Host B inside its subnet → direct communication possible from A to B o Host B sees Host A outside its subnet → will send packets to router to reach A
  • Case 3: o Host A: 130.192.1.1/25 (Subnet mask 255.255.255.128) o Host B: 130.192.1.100/24 (Subnet mask 255.255.255.0) o Host A’s subnet: 130.192.1.0 - 130.192.1. o Host B’s subnet: 130.192.1.0 - 130.192.1. Result: both hosts consider each other inside their subnet.

Two or more networks are aggregatable if they can be combined into a single larger network with a shorter subnet mask that includes all their addresses continuously.

  1. Identify the original networks and their subnet masks.
  2. Convert network addresses to binary.
  3. Check if the networks are adjacent and if they share a common prefix when masked with a shorter subnet mask.
  4. Determine the new subnet mask that covers both networks. Example:
  • Network 1: 192.168.1.0/24 (192.168.1.0 – 192.168.1.255)
  • Network 2: 192.168.2.0/24 (192.168.2.0 – 192.168.2.255) Are they aggregable? Yes, because:
  • They are contiguous (192.168.1.x ends at .255, 192.168.2.x starts at .0).
  • They can be combined under the network 192.168.0.0/22, which covers the address range 192.168.0.0 to 192.168.3.255. 0.0.0.0/0 is the default router. A default router, also called a default gateway, is a network device (usually a router) that serves as the next hop for any IP packet whose destination address is not within the local subnet or for which the sending device does not have a more specific route.

IPv4 multicast

It’s a communication model which can be used by IPv4 and IPv6. In IPv6 there’s no broadcast, so broadcast communications will be handled by multicast. Multicast is a form of communication where packet are routed from one single source to multiple destinations simultaneously. Instead of sending multiple copies of the same packet—each addressed to a different host—the source sends just one copy. This packet carries a special address known as a multicast address, which identifies a group of hosts rather than a single destination. In other words, it is not a unicast address for one host, but a collective address for many. This mechanism is especially useful for group communications, such as videoconferencing or live video broadcasting. However, large-scale streaming services like Netflix or Amazon Prime Video do not rely on multicast; they typically use unicast connections, sending individual streams to each client. Multicast is more common in environments where the entire network is managed by a single operator or in local networks, since proper configuration of routers is essential. The principle of multicast is straightforward: a packet is sent to a multicast address, and any host interested in receiving that traffic must explicitly subscribe to the group associated with that address. Membership is dynamic, hosts can join or leave groups at any time. Within a group, hosts can also decide whether they want to receive traffic from all senders or only from specific sources. Routers play a crucial role in managing multicast groups. They keep track of which hosts are subscribed and which host are active in each of this group and ensure that packets are forwarded appropriately. Each group has its own multicast address, but hosts still retain their individual unicast IP addresses. The multicast address simply acts as a placeholder for group membership. Delivery of packets relies on collaboration between Layer 3 (IP) and Layer 2 (typically Ethernet). Multicast addresses belong to Class D that begin with 1110 → 224.0.0.0 - 239.255.255.255. You’ll never find other IP addresses which start with 1110!

More advanced switches implement IGMP snooping. These switches inspect IGMP messages, even though IGMP is encapsulated in IPv4 packets, which switches normally ignore. By “snooping” into Layer 3, the switch learns which ports have hosts that are members of a multicast group. This allows the switch to forward multicast traffic only where it is needed, instead of flooding it across the entire LAN. This is a cross-layer technique because a Layer 2 device (the switch) must interpret Layer 3 control traffic. When a switch receives an IGMP membership report, it becomes aware that the host on that port has joined a multicast group. As a result, the switch activates filtering rules so that the multicast MAC address associated with the group is recognized and forwarded only to that host. This process requires a cross-layer approach: the switch must “snoop” into the IPv4 packet to identify IGMP control traffic and detect which multicast group is being requested. However, IGMP operates only within a local network segment. Membership reports never cross routers; they are delivered only to the nearest router, which records the local group membership. This raises a key challenge: how can a router learn which other routers are responsible for delivering the same multicast traffic, especially when the traffic originates from a remote part of the network? To solve this, routers use Protocol Independent Multicast (PIM), a routing protocol designed specifically for multicast. While IGMP manages host membership locally, PIM allows routers to coordinate globally. Routers use these protocols to build a distribution tree for each multicast group. The tree ensures that packets are delivered only to LANs with active group members, while avoiding unnecessary duplication of traffic. Routers exchange messages to build a multicast distribution tree:

  • Join messages are used to add branches, allowing a router to become part of the distribution tree for a multicast group.
  • Prune messages are used to cut branches when no downstream receivers remain, preventing unnecessary traffic. In addition, routers periodically send IGMP general query messages on their local networks to verify which hosts are still active members of multicast groups. Combined with PIM, this ensures that multicast traffic is efficiently delivered only where it is needed, minimizing wasted bandwidth. Despite its efficiency, multicast is not widely supported on the global Internet. It introduces challenges for traffic engineering, since operators lose fine-grained control over traffic flows, and it can raise security concerns. As a result, multicast is mostly confined to controlled environments, such as IPTV or video broadcasting within an ISP’s network, where the operator manages both the infrastructure and the multicast configuration. Finally, applications are responsible for letting hosts know which multicast groups to join. Typically, an app queries a server to learn about active multicast groups and then subscribes to the appropriate one on behalf of the user. This ensures that membership management remains transparent to end users.

IPv

Motivation and History

IPv6 is the most recent version of the Internet Protocol, and today most devices are equipped with both an IPv4 and an IPv6 address. The primary motivation for IPv6 was the need for a larger address space. IPv4’s 32-bit address space was running out, and IPv6 expanded this dramatically with 128-bit addresses. There were also other motivations, some of which were later partially addressed within IPv4 itself:

  1. More efficient on LANs→ IPv6 was designed to allow more cooperation between Layer 2 and Layer 3, improving the efficiency of local area network
  2. Multicast and anycast→ Native support for more advanced addressing and communication models.
  3. Security → IPv6 aimed to provide built-in mechanisms for securing transmitted information, something IPv originally lacked.
  4. Policy routing → IPv4 routing was mainly based on address aggregation to simplify routing tables, but it didn’t consider the preferences of carriers. Modern providers need finer control over routing paths, not only to decide the destination but also to control which networks and regions traffic crosses. This matters for

reasons like censorship, surveillance, or geopolitical concerns. IPv6 promised to enable this type of policy- based routing.

  1. Plug-and-play addressing → In early IPv4, devices had to be manually configured. IPv6 introduced automatic configuration. Over time, IPv4 adapted and also implemented DHCP and automatic configuration, but originally this was an IPv6 innovation.
  2. Traffic differentiation
  3. Quality of service support → IPv6 aimed at offering better quality of service support.
  4. Mobility → IPv6 supported mobile and portable devices more effectively, which was not initially a consideration in IPv4. IPv4 was defined in the 1980s, while IPv6 was conceived in the mid-1990s. However, its actual deployment was extremely slow. By the 2000s, some implementations started appearing, but widespread adoption took a very long time. Because IPv6 adoption was so gradual, many of the features it introduced were eventually ported back into IPv4 or workarounds were created (e.g., NAT – Network Address Translation). As a result, IPv4 remained “good enough” for many years, and networks could continue operating without an urgent need for IPv6. When IPv6 was accepted as a standard, the IPv4 user base was already massive — hundreds of millions of hosts worldwide. A complete, immediate switchover (“flag day”) was impossible. Migrating all hosts and routers simultaneously would have required enormous global coordination and risked bringing the internet to a halt. Such a disruption would have caused catastrophic economic losses. By the early 2000s, the internet was already at the center of a booming economy, particularly during the dot-com bubble. Many companies and startups depended entirely on internet connectivity. A sudden transition could have led to enormous instability. Therefore, the deployment of IPv6 had to be gradual, ensuring compatibility with IPv4 during the transition.

Why are IPv4 addresses scarce?

IPv4 addresses are 32 bits long, which means there are about 4.3 billion possible addresses in total. At first glance, that number looks large, but in practice it turned out to be insufficient. Not all of those 4 billion addresses are actually available for end hosts. Addresses were divided into classes (A, B, C) for hierarchical management. While this made it easier to interpret addresses, it also led to significant waste of address space. Some ranges (e.g., those starting with 111) were reserved for multicast or other special purposes. As a result, the number of usable IPv4 addresses is closer to 3.5 billion. IPv4 uses hierarchical allocation. Each physical network must have a unique prefix, which cannot be reused elsewhere. This system improves organization but fragments the available space. The subnetting system works in powers of two. If a network requires, for example, 1,048 hosts, you must allocate a block that supports at least that many — the next available size might be 4,096 addresses. That means more than 3,000 addresses are wasted. This inefficiency was unavoidable in the IPv4 design, and it led to many addresses being left unused, even though the global demand for addresses kept increasing. The demand for IP addresses quickly outgrew IPv4’s capacity:

  • The world population is about 8 billion, and at least half of them have internet access at home.
  • There are over 5.5 billion mobile phones worldwide that need connectivity.
  • Many individuals own multiple devices (e.g., phone, laptop, tablet, smartwatch). This pushes the demand far beyond 8 billion addresses, reaching an estimated 20 billion devices.
  • On top of that, the rise of the Internet of Things (IoT) is expected to add tens of billions of additional connected devices. IPv4 simply cannot keep up. The combination of:
  • Limited usable space (due to classes, reserved ranges, hierarchical allocation), and
  • Explosive growth in connected devices led to address exhaustion. No matter how efficient subnetting becomes, the waste is inherent to the system. This is why IPv4 is fundamentally inadequate for today’s internet and why IPv6 was necessary.

IPv4 Address Pool status

An IPv4 address can be in different states:

  • Reserved for special use
  • Unallocated (still in IANA pool — very few left today)
  • Unassigned (held by RIRs but not distributed yet)
  • Assigned but not advertised (allocated to a user, but not in BGP tables → wasted)
  • Assigned and advertised (in use and visible in routing tables) Some IPv4 address blocks remain unadvertised because they were either over-allocated in the past or left unused after old assignments. This situation contributes to overall inefficiency in address usage. A significant portion of these addresses — particularly in ranges like 128.x.x.x to 200.x.x.x — are technically assigned but remain unused. They are mostly leftovers from earlier allocations, especially from the era of Class C addresses. At the time, many small Class C networks were distributed, later collected and aggregated, but eventually abandoned because their size was too limited to be useful. As a result, these addresses simply remain unused, sitting idle in the global pool.

Routing Scalability Issues

Another side effect of IPv4 exhaustion is the explosion in routing table size. Each subnetwork must be advertised separately in BGP. Because address assignments are fragmented and scattered across regions, prefixes that belong to the same larger block may end up in different countries.

For example:

  • 150.183.0.0/16 assigned to networks in France
  • 150.183.8.0/24 assigned to a network in Greece Although both belong to the same block, routers cannot aggregate them into a single route. Instead, they must maintain two distinct entries, one for France and one for Greece. This fragmentation leads to:
  • Larger routing tables (now approaching 1 million entries)
  • Higher router resource consumption (memory and CPU)
  • Increased lookup delays, since routers must perform a longest prefix match for each packet
  • More frequent route changes, especially at the backbone level Routers can mitigate the cost of lookups using algorithms like balanced trees or specialized data structures, but the fundamental problem remains: route aggregation is severely limited. Aggregation is only possible when prefixes are both numerically adjacent and geographically consistent. For instance, if two contiguous /24 networks are located in the same region, they can be aggregated into a single /23 route. But if those same networks are assigned to organizations in different countries, aggregation is impossible—routers must still keep them as separate entries. This inefficient and fragmented assignment of IPv4 prefixes is what drives the uncontrolled growth of routing tables, making Internet routing more complex, slower, and resource-intensive.

Possible solution with IPv

One of the proposed interim solutions to address the growth of routing tables in IPv4 was route aggregation. The idea was to combine multiple contiguous networks into a single, shorter prefix. For example: Instead of advertising 1.2.1.0/24 and 1.2.2.0/24 separately, both could be aggregated into 1.2.0.0/16. This approach was formalized as CIDR (Classless Inter-Domain Routing), which eliminated the rigid boundaries of classful addressing (Class A, B, C). CIDR significantly improved efficiency by allowing flexible prefix lengths and route aggregation. However, CIDR’s effectiveness was limited by the historical, non-rational assignment of IPv4 prefixes. Since addresses had already been allocated in a fragmented and inconsistent way, many blocks could not be aggregated, leaving the routing scalability issue only partially mitigated. Another measure was the introduction of Regional Internet Registries ( RIRs). These organizations began distributing addresses in larger, contiguous blocks only to major ISPs and organizations. For example, instead of handing out small /24s, they would allocate a /20 block (≈4096 addresses) to allow better aggregation. Even with these measures, routing scalability remained a major problem. Routing protocols could not indefinitely keep up with the exponential growth of entries. This limitation was one of the driving factors behind the design of IPv6, although the problem is not yet fully solved.

mathematically infinite for human purposes, but packet headers would become unreasonably large. Thus, IPv6 struck a balance: large enough to ensure scalability and inefficiency tolerance, but not so large as to make packet handling wasteful.

Notation

IPv6 addresses are 128 bits long, so their dotted decimal notation would consist in 16 decimal numbers. That’s not really the best, so we use a different notation instead: 8 hexadecimal numbers separated by “:”

x:x:x:x:x:x:x:x

Examples:

  • FEDC:0000:0876:45FA:0562:0000:3DAF:BB
  • 1080:0000:0000:0007:0200:A00C:3423:A To make them more compact, two shortcut rules apply:
  1. Leading zeros in a field can be omitted. a. 0007 → 7 b. 1080:0000:0000:0007... → 1080:0:0:7...
  2. Consecutive groups of zeros can be replaced with ::, but this can only be done once per address to avoid ambiguity FEDC:0000:0876:45FA:0562:0000:3DAF:BB01 → Example:
  • Initial address: 1080:0000:0000:0007:0200:A00C:3423:A
  • Applying rule 1: 1080:0000:0000:0007:0200:A00C:3423:A089 −→ 1080:0:0:7:200:A00C:3423:A
  • Applying rule 2: 1080:0000:0000:0007:0200:A00C:3423:A089 −→ 1080::0007:0200:A00C:3423:A
  • Applying both rules: 1080::7:200:A00C:3423:A N.B. The “::” stand for “you have to add as many 0s as it’s needed to reach the total 128 bits length”.

Routing and Addressing Principles Host Addresses

IPv6 maintains the same routing principles as IPv4. If the source and destination share the same prefix, delivery is direct using the local MAC address. If the prefixes differ, the packet is sent through a router. There are some significant differences between IPv6 and IPv4 addresses structure:

  • IPv6 doesn’t adopt any netmask;
  • IPv6 has no address classes (unlike IPv4 A/B/C/D/E).
  • The address/netmask pair is substituted by a prefix notation: Address/N where N is the prefix length in bits.
  • No address classes! Example:
  • Address: FEDC:0123:8700::3/
  • Prefix (also called site prefix ): 1111 11101101110000000001001000111000011100000000
  • Interface ID: 0000 0000000000000000000000000000000000000000000000000000000000000000000000000011 Example FEDC:0123:8700::100/ The first 40 bits of this address are its prefix. The remaining 88 bits are the interface ID:
  • Prefix: 1111 1110 1101 1100 0000 0001 0010 0011 1000 0111 (hex: FEDC 0123 87);
  • Interface ID: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0000 0000 (hex: 00 0000 0000 0000 0000 0100); Address assignment principles are the same as IPv4 but the terminology is different:
  • Subnetwork: set of hosts with same prefix
  • Link: physical network (in IPv6, subnet = link).
  • On-link hosts have the same prefix → Direct communication
  • Off-link hosts have different prefix → Communication through a router

IPv6 Address Types

IPv6 defines three main categories of addresses:

  1. Unicast – one-to-one communication.
  2. Multicast – one-to-many communication.
  3. Anycast – one-to-nearest communication (delivered to the closest host based on routing).

Multicast

IPv6 relies much more heavily on multicast than IPv4, since it replaces some IPv4 functions such as ARP or ICMP-based discovery. In IPv6, multicast addresses start with a sequence of eight 1s. Using IPv6 notation, we can write multicast addresses range as:

FF00::/

which includes all addresses whose prefix is FF FF00:: −→ FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF that corresponds to 2120 multicast addresses! (equivalent to the IPv4 multicast address 224.0.0.0/4 (1111 1111…)) This huge range of addresses is further divided into:

  • Well-known multicast addresses (FF00::/12) : predefined or reserved multicast addresses for assigned groups of devices (e.g., all routers).
  • Transient multicast addresses (FF10::/12): dynamically assigned by multicast apps

They start by 001 ;

Usually, the first 48 bits (after 001) form the Global Routing Prefix. In the past, those bits were assigned depending on the Internet Service Provider. The top level authority, IANA, assigned the first 13 bits to different areas, the regional level authority assigned the next 32 bits and the subnet level authority assigned the last 16 bits. However, this guide line was soon abandoned because of its complexity. So, because we have so many addresses, a much more straightforward approach consists in assigning chunks of 48 bits. Today’s Global Routing prefix was formerly assigned by multi-level authorities: IPv6 global unicast assignment (deprecated)

Link local addresses

Link/site local: 1111 1110 1…. Link local addresses: usually, they have all 0s from the 10th up to the 64th bit; they’re addresses which must never be routed outside a local network. They’re similar to private addresses but they’re not the same (they also belong to different groups); Link local is used for addresses on a single link for auto-address configuration, neighbor discovery, or when no routers are present. Packets sent to these addresses are not supposed to be forwarded across local links

Their range is FE80::/ 64 (1111 1110 10….)

Site local addresses

Site local addresses were meant to be confined inside a site but no one could quite agree what exactly the “site” was (a company? a branch of a company?), so they’ve been deprecated.

Their address range was FEC0::/

Unique Local addresses

They’re the equivalent of private IPv4 addresses; Similar to global unicast addresses but just for private use, so they must be routed only in private links (e.g., inside an organization) and not be routed in the global Internet. They must be unique inside the same organization but could

be duplicate within different companies; It is used for devices that never need access to the Internet and never need to be accessible from the Internet. They’re separate from link local addresses;

Their range is FC00::/

The 8th bit is the “Local (L) Flag”, dividing the range in:

  • fc00::/8 (1111 110 0 ): If L flag is 0 , may be defined in the future
  • fd00::/8 (1111 110 1 ): If L flag is 1 , the address is locally assigned
  • fd00::/8 are the only valid ULA addresses today!

IPv4 embedded addresses

When you must route packets through a network which includes both IPv4 and IPv6, you may want to preserve your IPv4 address. To do so, IPv6 is chosen to mimic an IPv address. The IPv6 address includes the imprint of the IPv4 address! These addresses will never interfere with other IPv6 addresses, because they don’t overlap on the Global unicast IPv6 addresses range (they don’t start with 001). They are used to represent an IPv4 address inside an IPv6 address → aid the transition from IPv4 to IPv6. The IPv4 address is carried in the low-order 32 bits e.g., IPv6 compressed format of IPv4-mapped 20.10.4.3 → address: ::ffff:20.10.4.

Loopback addresses

Used by a node to send an IPv6 packet to itself for testing reasons They are identified by the address ::1 (000…1), equivalent to IPv4 address: 127.0.0. Same rules as IPv4:

  • cannot be assigned to a physical interface.
  • packets with a loopback address should never be sent beyond the device.
  • routers can never forward packets with a destination address that is a loopback address.
  • device must drop a packet received on an interface if the destination address is a loopback address.
Unspecified addresses

An unspecified unicast address is an all-0s address. It is used as a source address to indicate the absence of an address. It cannot be assigned to an interface. They’re used in Duplicate Address Detection (DAD) in ICMPv6;

Anycast addresses

Anycast addresses are assigned to more than one interface (typically different devices). A packet sent to an anycast address is routed to the “nearest” interface having that address, according to the router’s routing table

  • Requires cooperation of BGP ( Border Gateway Protocol ) to configure routing tables properly.
  • The user has no direct awareness: the same IP may resolve to different servers depending on location. Initially designed for DNS but still in the experimental stages (although first RFC dates back to 1993!) Examples:
  • DNS Anycast: 8.8.8.8 (Google DNS) routes you to the closest Google server.