5.6 L3 in the Internet - faculty.tarleton.edu

Post on 06-Jun-2022

1 views 0 download

Transcript of 5.6 L3 in the Internet - faculty.tarleton.edu

5.6 L3 in the Internet

• 5.6.1 The IP Protocol (IP v.4)• 5.6.2 IP Addresses• 5.6.3 IP v.6• 5.6.4 Internet Control Protocols• OSPF – The Interior Gateway Routing Protocol• BGP – The Exterior Gateway Routing Protocol• Internet Multicasting• Mobile IP

SKIP

Internet = Collection of many (sub)networks

A pkt. going from 1 to 2 traverses 6 networks (source and destination networks included).

IP (Internet Protocol) was designed to provide a best-effort way (i.e. datagram, or connectionless) to transport pkts. from source to destination, irrespective of how many networks are in between.

Architectural Principles for InternetRFC 1958 http://tools.ietf.org/html/rfc1958

1. Make sure it works.2. Keep it simple. (KISS! )3. Make clear choices.4. Exploit modularity.5. Expect heterogeneity.6. Avoid static options and parameters.7. Look for a good design; it need not be perfect (a.k.a.

“satisficing” in A.I.)8. Be strict when sending and tolerant when receiving.9. Ensure scalability (see next slide!).10. Consider performance and cost.

9. ScalabilityMake the core “dumb” and the edge “smart”

Image source: http://www.ipjforum.org

CE = Customer Edge Router, PE = Provider Edge Router, P = Provider Core Router

5.6.1 The header of an IPv.4 pkt. (a.k.a. datagram)

Initially 3 bits Precedence + 3DTR(Delay, Throughput, Reliability)

Today 6 DSCP (DiffServ Code Points)

In 32-bit words → max 60 byte for entire header→ max 40 byte for Options.

In multiples of 8 bytes. All fragments except the last must be such multiples.

IP v.4 or IP v.6IP v.5?

More FragmentsDon’t Fragment

Congestion?

In Bytes, the entire pkt.

Which original pkt. does this fragment belong to?

Q: Why not specify the Total length in multiples of 4 Bytes (32 bits)?

A: Because the pkt. payload that follows this header is not necessarily a multiple of 4 Bytes!

In Bytes, the entire pkt.

Extra-credit

Important examples: ICMP=1, IP=4, TCP=6, UDP=17Go to http://www.iana.org/assignments/protocol-numbers for the

complete list of protocols

Must be recomputed at each hop, since at least TTL changes

Originally designed to count time (sec.)Today counts only hops.

Padded to the next multiple of 4 Bytes

IP options (rarely used, most routers ignore them)

A total of 25 options (2 obsolete) are defined athttp://www.iana.org/assignments/ip-parameters

More reading here: http://www.eecs.berkeley.edu/Pubs/TechRpts/2005/EECS-2005-24.pdf(link on our webpage)

5-54

The core is “dumb”, so it shouldn’t pay attention to them!

Internet Assigned Numbers Authority

Example IP pkt. (datagram) Source: RFC 791

Error and flow control in IP?Source: RFC 791

Read carefully the entire section 5.6.1 in our text!

IPv.4 addresses have 32 bits

Dotted-decimal notation: Each Byte is represented in its decimal value, with dots in between, e.g.

0010 1010 1000 0000 1100 0000 0000 0111 (binary) == 0x2 A 8 0 C 0 0 7 (hex) == 42.128.192.3 (dotted-decimal)

Your turn!Convert between hex and dotted-decimal:

a) 0xAB CD EF 23 =

a) 193.32.67.20 =

Convert between hex and dotted-decimal:

a) 0xAB CD EF 23 = A∙16+B + C∙16+D + E∙16+F + 2∙16+3 =

a) 193.32.67.20 =

Solution

Convert between hex and dotted-decimal:

a) 0xAB CD EF 23 = A∙16+B . C∙16+D . E∙16+F . 2∙16+3 =

= 171 . 205 . 239 . 35

a) 193.32.67.20 =

Solution

Convert between hex and dotted-decimal:

a) 0xAB CD EF 23 = A∙16+B . C∙16+D . E∙16+F . 2∙16+3 =

= 171 . 205 . 239 . 35

a) 193.32.67.20 = C1

193 / 16 = 6 rem. 4 0x64

Solution

Convert between hex and dotted-decimal:

a) 0xAB CD EF 23 = A∙16+B . C∙16+D . E∙16+F . 2∙16+3 =

= 171 . 205 . 239 . 35

a) 193.32.67.20 = C1 20 43 14

32 / 16 = 2 rem. 0 0x20

67 / 16 = 4 rem. 3 0x43

20 / 16 = 1 rem. 4 0x14

Solution

An IPv4 address has two parts: prefix (a.k.a. network or subnet) and host.5.6.2 IP Addresses

In general the number of available hosts on a subnet is 2n−2.

RFC 3021 specifies an exception to this rule when dealing with 31-bit subnet masks (i.e. 1-bit host identifiers). In such networks, usually point-to-point links, only two hosts (the end points) may be connected and a specification of network and broadcast addresses is not necessary.

A campus network consisting of subnets

(LANs) for various departments.

From Ch.1: The subnet is the routing infrastructure of the Internet, a.k.a. the core.

Ambiguity: the two meanings of “subnet”

MasksFor routing purposes, the prefix part is treated separately from the host part of the address.To make the separation easier, a binary number of the same length as the address (32 bits) is being used, called a mask.For example, a /26 subnet mask is represented thus:

1111 1111 . 1111 1111 . 1111 1111 . 1100 0000= 255.255.255.192 When an address is AND-ed with the mask, only the network part survives!

• Each router table entry contains a network address and a subnet mask, e.g. 128.42.43.44/24

• Note well: The packets themselves do not carry masks, only SA and DA

• In a router, the masks in the routing table are AND-ed with the DA of the packet, then matched against the corresponding network address

• Scaling: a router has in its routing table only its local (i.e. LAN) hosts and all other network prefixes

Example: /26 network prefixes

Here the subnet mask consists of 26 bits, leaving 6 bits for the host identifier. This allows for 64 combinations (26), however the all zeros value and all ones value are reserved for the network ID and broadcast address respectively, leaving 62 addresses.

Source: Wikipedia

QUIZ: (sub)net mask

A packet with the address 192.168.5.133 arrives at this router. Show how the router decides which (sub)net the packet belongs to, using the masks!1111 1111 1111 1111 1111 1111 1100 000

Special IP AddressesOnly used in certain

ICMP pkts.

QUIZ

How many hosts can a /17 network have?

What is the broadcast address (from the outside) of the network 172.29.96.0/20?

What valid host range is the IP address 192.168.149.58/30 a part of?

How many hosts can a /17 network have?A: 232-17 – 2 = 32,766

What is the broadcast address of the network 172.29.96.0/20?

A: 172.29.111.255

What valid host range is the IP address 192.168.149.58/30 a part of?

A: 192.168.149.57 through to 192.168.149.58

http://www.subnettingquestions.com/

Solution

For more practice:

IP addressing questions (and answers):http://www.subnettingquestions.com/

SubnettingIdea: Split up the IP prefix of a network into subnet(work)s to help with address management:– All this looks like a single prefix outside the network, which makes the system scalable!

The network divides it into subnets internally

The ISP gives the client networka single Class B prefix

SubnettingThe binary view

QUIZ: SubnettingWhat is the last, unused

subnet in this example?Write it in “slash” notation.

AnswerWhat is the last, unused

subnet in this example?Write it in “slash” notation.

Answer: 128.208.64.0/19

The opposite of subnetting: Aggregation Aggregation (a.k.a. supernetting) joins multiple IP prefixes

into a single larger prefix to reduce routing table size

ISP customers have different prefixes

ISP advertisesa single prefix

Aggregation example

(Destination) Address Mask

11000010 00011000 00000000 00000000 11111111 11111111 11111000 0000000011000010 00011000 00001000 00000000 11111111 11111111 11111100 0000000011000010 00011000 00001100 00000000 11111111 11111111 11111100 0000000011000010 00011000 00010000 00000000 11111111 11111111 11110000 00000000

aggregation point = right-most point to the left of which all addresses are the same

Main prefix goes this way

Except for this part!

Longest Matching PrefixPackets are forwarded to the entry with the longest matching

prefix (or smallest address block)– Complicates forwarding but adds flexibility– Routing tables often contain a default route, which has

the shortest possible prefix match, to fall back on in case matches with all other entries fail.

QUIZ: Longest Matching Prefix

Which interface will the pkt. go to?

QUIZ: AggregationA router has the following subnets in its routing table:

(a) Convert the relevant part of each subnet to binary

QUIZ: AggregationA router has the following subnets in its routing table:

(a) Convert the relevant part of each subnet to binary

QUIZ: AggregationA router has the following subnets in its routing table:

(b) In order to reduce the size of the routing table, the decision was made to aggregate these 5 subnets into one. What is the aggregated subnet?

QUIZ: AggregationA router has the following subnets in its routing table:

(b) In order to reduce the size of the routing table, the decision was made to aggregate these 5 subnets into one. What is the aggregated subnet?

QUIZ: AggregationA router has the following subnets in its routing table:

(b) In order to reduce the size of the routing table, the decision was made to aggregate these 5 subnets into one. What is the aggregated subnet?

42.43.32.0/19

QUIZ: Aggregation

(c) Where are the “holes” in this aggregated subnet? Write the first and last address in each hole.Determine the size of each hole (how many addresses?).

42.43.32.0/19

No solution – see part (d)

QUIZ: Aggregation

(d) What are the /22 and /23 subnets (choose largest one first!) that will possibly fill the holes in the future?

42.43.32.0/19

QUIZ: Aggregation

(d) What are the /22 and /23 subnets (choose largest one first!) that will possibly fill the holes in the future?

42.43.32.0/19

SKIP the sub-sectionClassful Addressing (pp.449-451)

… except for knowing that in the older version of the IPv4 standard, the boundaries between subnet and host

were “set in stone” at 8, 16, and 24 bits

Initial IP address formats (classful addressing).

RFC 791 Internet Protocol (Sept.1981)

/8

/16

/24

Special IP Addresses continued:“private” addresses

One Class A Network: 10.0.0.016 Class B Networks: 172.16.0.0 - 172.31.0.0

256 Class C Networks: 192.168.0.0 - 192.168.255.0

These are reserved for networks not connected to the Internet (at least not directly connected – see NAT later in this section)

QUIZ for individual work

One Class A Network: 10.0.0.016 Class B Networks: 172.16.0.0 - 172.31.0.0

256 Class C Networks: 192.168.0.0 - 192.168.255.0

What is the total # of private addresses, in all the blocks shown above?

NAT (Network Address Translation)

pp.451-455

Read and take notes!

How IP addresses are were allocated

The Internet Assigned Numbers Authority (IANA) distributes top-level blocks to the 5 regional Nw. Info Centers (NIC), which then assign sub-blocks to end users and local Internet registries, such as Internet service providers, universities and businesses.

Source: http://en.wikipedia.org/wiki/IPv4_address_exhaustion

Exhaustion of IPv4 address spaceOn 31 January 2011, the last two unreserved IANA /8 address blocks were allocated to APNIC according to RIR request procedures. This left five reserved but unallocated /8 blocks. In accord with ICANN policies, IANA proceeded to allocate one of those five /8s to each RIR, exhausting the IANA pool, at a ceremony and press conference on 3 February 2011.

APNIC was the first regional Internet Registry to run out of freely allocated IPv4 addresses, on 15 April 2011.

Source: http://en.wikipedia.org/wiki/IPv4_address_exhaustion

Asia-Pacific Network Information Centre

Exhaustion of IPv4 address space

What countermeasures have been tried:• Classes (1981)• CIDR (1993)• NAT (1999)• and …

IP Version 6 – Dec.1998, RFC 2460Major upgrade due mainly to the impending address exhaustion, but also w/other goals:

–Support billions of hosts–Reduce routing table size–Simplify protocol–Better security–Attention to type of service–Aid multicasting–Roaming host without changing address–Allow future protocol evolution–Permit coexistence of old and new protocols

IPv6 header and is simpler, and it can use optional extension headers (EH)

main header40 Bytes

Zero or more extension headers follow the main header

All EHs are a multiple of 8 octets in size (may have to use padding!)EHs should appear at most once, except for the Destination Options header, which may appear twice. There are 8 EHs currently defined.

QUIZCompare the• Minimum size• Maximum sizeof the IPv4 and IPv6 headers

Solution• Minimum hdr. size:

• IPv4: 20 B• IPv6: 40 B

• Maximum hdr. size:• IPv4: 60 B (see the IHL field!)• IPv6: Acc. to RFC 2460, there can be any number of

(chained) Extension Headers (EH), however, the later RFC 7112 places the restriction that the entire header must fit inside the "path MTU". The minimum MTU in IPv6 is 1280 B.

Wait a second! How does IPv6 handle fragmentation?

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Implements Virtual Circuits

(see p.358)

256 possible extension headers

(in the last header it means L4 protocol

like in IPv4)

Identical to TTL from IPv4

Header excluded, but extension

headers included!

QoS

In IPv6, fragmentation information is

carried in a specialized

EH.

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

QUIZCompare the• Minimum size• Maximum sizeof the IPv4 and IPv6 packets.

IPv6 addresses are much longer (128 vs. 32 bits)

Compare the number of possible IPv6 addresses with the number of bacteria living on earth, which is estimated to be

5,000,000,000,000,000,000,000,000,000,000. = 5∙1030

Source: http://www.ehow.com/about_4674401_how-many-bacteria-live-earth.html

40 Bytes

The “colon” and “double-colon” notationsfor IPv6 addresses

Dotted decimal would be too hard to read, so we’re grouping 4 hex digits, and use colons for separation:

8000 : 0000 : 0000 : 0000 : 0123 : 4567 : 89AB : CDEF

Due to the huge address space, it is common to have consecutive zeros, so the “double colon” abbreviation is used:

8000 :: 0123 : 4567 : 89AB : CDEFOf course, there can be only one double colon in any address.

IPv6 and the “Internet of Things” (IoT)

The catch: Individual bulbs run in the $20 to $30 range!

http://www.greentechmedia.com/articles/read/the-ipv6-addressable-light-bulb-goes-on-sale

IPv6 Extension Headers All routers along

the path must examine it!

E.g.: hop-by-hop header has an option for jumbogram

# of Bytes is specified on 32 bits.Excludes main hdr., but includes all extension hdrs.

QUIZWhat is the maximum size of an IPv6 packet if the jumbogram

header is used?

ConclusionIPv6 improvements over IPv4

• Longer addresses (128 bits vs. 32)• Simpler header (7 fields vs. 13)• Better support for options (extension headers)• Native support for security:

• Authentication• Privacy

• QOS (Quality of Service)• The Diff.Serv. field defines traffic class.• The Flow Label field supports VCs.

IPv6 vs. IPv4IPv6 does not specify interoperability features with IPv4, but essentially creates a parallel, independent network.•Exchanging traffic between the two networks requires translator gateways employing NAT64; or other transition technologies, such as tunneling protocols•However, IPv6 is compatible with the auxiliary Internet protocols (see next Sec. 5.6.4)

Deployment of IPv6 has been slow & painful, but is picking up pace now that IPv.4 addresses are exhausted.

“In 2018 only 25.3% of the about 54,000 autonomous systems advertised both IPv4 and IPv6 prefixes in the global Border Gateway Protocol (BGP) routing database.”

http://en.wikipedia.org/wiki/IPv6#Deployment

IPv6 deployment• IPv6 has been implemented on all major operating systems in

use in commercial, business, and home consumer environments.

• Since 2008, DNS (domain name system) can be used in IPv6. • IPv6 was first used in a major world event during the 2008

Summer Olympic Games, the largest showcase of IPv6 technology to date.

• Some governments (incl. U.S. and China) are starting to require IPv6 capability on their equipment.

• In 2009, Verizon mandated IPv6 operation and deprecated IPv4 as an optional capability for cellular (LTE) hardware. T-Mobile USA followed suit: as of June 2012, they support external IPv6 access.

http://en.wikipedia.org/wiki/IPv6#Deployment

Homework for Ch.51, 2, 6, 7, 16, 24, 26, 27, 28, 30

Due Thu after Thnxgiving, Dec.3

EOL2

Example: Viewing the routing table in Windows

Initially 3 bits Precedence + 3DTR(Delay, Throughput, Reliability)

Today 6 DSCP (DiffServ Code Points)

In 32-bit words → max 60 byte for entire header→ max 40 byte for Options.

In multiples of 8 bytes. All fragments except the last must be such multiples.

IP v.4 or IP v.6IP v.5?

More FragmentsDon’t Fragment

Congestion?

In Bytes, the entire pkt.

Which original pkt. does this fragment belong to?

Important examples: ICMP=1, IP=4, TCP=6, UDP=17Go to http://www.iana.org/assignments/protocol-numbers for the

complete list of protocols

Must be recomputed at each hop, since at least TTL changes

Originally designed to count time (sec.)Today counts only hops.

Padded to the next multiple of 4 Bytes