CS 3640: Introduction to Networks and Their Applications Fall 2018, - - PowerPoint PPT Presentation

cs 3640 introduction to
SMART_READER_LITE
LIVE PREVIEW

CS 3640: Introduction to Networks and Their Applications Fall 2018, - - PowerPoint PPT Presentation

CS 3640: Introduction to Networks and Their Applications Fall 2018, Lecture 10: The Network Layer I: Packet fragmentation, IPv4, and IPv6 (Credit: Christo Wilson @ NEU) Instructor: Rishab Nithyanand Teaching Assistant: Md. Kowsar Hossain 1


slide-1
SLIDE 1

1

CS 3640: Introduction to Networks and Their Applications

Fall 2018, Lecture 10: The Network Layer I: Packet fragmentation, IPv4, and IPv6 (Credit: Christo Wilson @ NEU) Instructor: Rishab Nithyanand Teaching Assistant: Md. Kowsar Hossain

slide-2
SLIDE 2

2

You should…

  • Be checking Piazza regularly for announcements.
  • Have started working on assignment 2.
  • Know and understand:
  • The three Internet design principles.
  • The components of the Internet.
  • Circuit- vs. packet- switched networks.
  • Components of end-to-end delay.
  • Functions of the link layer: error detection, MAC, local addressing/routing.
slide-3
SLIDE 3

3

Today in class

1.

Recap: Network layer functions

2. 3.

Packet fragmentation Internet Protocol v4 and v6

slide-4
SLIDE 4

Recap: Network layer functions and IP addressing

  • What are the functions of the network layer?
  • Addressing: How do we specify who we want to talk to on the Internet?
  • Forwarding: How do we make sure our router knows what the next hop is? (local)
  • Routing: How do we make sure our packets get to the other side? (global)
  • What type of guarantees can the network layer make? Why?
  • Best effort service without guarantees. It has to serve the lowest common

denominator.

  • Why doesn’t “flat addressing” work on the Internet? What does?
  • Flat addressing is not scalable. Too many routing table entries for every router.
  • Hierarchical addressing scales better. Don’t need to have entries for all routers.
  • Need highly specific information only for routers in their own network.
slide-5
SLIDE 5

Recap: Network layer functions and IP addressing

  • How is hierarchical addressing implemented?
  • Each IP address has a “network” string known to all routers and a “host”

string known to edge routers (access networks).

  • What are the IP address classes and their limitations?
  • Class A networks are too big for access network routers.
  • How do we address this issue?
  • Subnetting – i.e., add another hierarchical layer to the address.
  • Class C networks are too many for everyone else.
  • How do we address this issue?
  • CIDR based routing table entries.
slide-6
SLIDE 6

Recap: CIDR (Classless Inter Domain Routing)

  • Key idea: Get rid of IP classes in routing tables.
  • With IP classes, routers need to remember how to reach each network –

there are 2.1M of them!

  • CIDR facilitates aggregation to reduce the number of entries by getting

rid of IP address “classes”.

  • How?
  • Think of IP addresses as leaves of a 32 level binary tree.
  • A node on the nth level can reach all nodes on the (n+1)th to 32nd levels that

have the same prefix.

  • CIDR representation means that routers just can store just the nth level entry

if the router uses the same next hop for all IP addresses reachable by it.

  • When you see a netmask of “16”, it means we’re talking about the 16th level

in this binary tree.

slide-7
SLIDE 7

Recap: CIDR (Classless Inter Domain Routing)

  • Key idea: Get rid of IP classes in routing tables.
  • How?
  • Think of IP addresses as leaves of a 32 level binary tree. A node on the nth level

can reach all nodes on the (n+1)th to 32nd levels that have the same prefix.

  • CIDR representation means that routers just can store just the nth level entry if

the router uses the same next hop for all IP addresses reachable by it. Prefix Netmask Prefix After Masking (in Binary) Next Hop Reachable Through 207.46.0.0 19

11001111 00101110 000***** ********

Port 1 207.46.32.0 19

11001111 00101110 001***** ********

Port 1 207.46.64.0 18

11001111 00101110 01****** ********

Port 1 207.46.128.0 18

11001111 00101110 10****** ********

Port 2 207.46.192.0 18

11001111 00101110 11****** ********

Port 3 207.46.0.0 18

11001111 00101110 00****** ********

Port 1 207.46.0.0 17

11001111 00101110 0******* ********

Port 1 Same length netmask All bits match except for the last one Same port

slide-8
SLIDE 8

8

Today in class

1.

Recap: Network layer functions

2. 3.

Packet fragmentation Internet Protocol v4 and v6

slide-9
SLIDE 9

Fragmentation at the network layer

  • The network layer interconnects many different networks.
  • Each of these could have different MTUs (Maximum Transmission Units).
  • This is the size of the largest frame the link layer can handle.
  • Anything bigger is not transmitted.
  • MTUs are unknown prior to sending a message.
  • How the IP protocol deals with this:
  • The network layer finds out the MTU of the current network.
  • Easy. They’re on the same device.
  • The network layer “fragments” packets so they all are compatible with the

current networks link layer.

  • Easy. Just take a transport layer datagram. Break it into (MTU – IP header)

sized chunks. Slap an IP header on each chunk. That’s one packet.

  • The network layer reassembles these frames so that the receiver can get the
  • riginal packet back.
  • Not so easy.
slide-10
SLIDE 10

Fragmentation at the network layer

  • Discuss: What information does the receiver need to have to

correctly reassemble packets?

MTU = 2000 MTU = 4000 MTU = 1500

Datagram Dgram1 Dgram2 1 2 3 4

slide-11
SLIDE 11

Fragmentation at the network layer

  • The IP protocol header has three fields to help with

reassembly.

  • Identifier: A unique number for the original (senders) datagram.
  • “MF” flag: More fragments to follow. This is 0 for the last fragment.
  • Offset: Which bytes from the original datagram are in the current packet.

Version

HLen TOS Datagram Length 8 16 24 31 4 12 19 Identifier

Flags

Offset TTL Protocol Checksum Source IP Address Destination IP Address Options (if any, usually not) Data

slide-12
SLIDE 12

Fragmentation at the network layer

MTU = 2000 MTU = 4000 MTU = 1500

Data Data Data IP Hdr IP IP

Length = 3820, M = 0 3800 20 Length = 2000, M = 1 Offset = 0 Length = 1840, M = 0 Offset = 1980 1980 20 1820 20

1980 + 1820 = 3800

slide-13
SLIDE 13

Fragmentation at the network layer

MTU = 2000 MTU = 1500

Data Data IP IP Data Data IP IP

Length = 2000, M = 1 Offset = 0 Length = 1840, M = 0 Offset = 1980 1980 20 1820 20 20 20 1480 500 Length = 520, M = 1 Offset = 1480 Length = 1500, M = 1 Offset = 0

Data Data IP IP

20 20 1480 340 Length = 360, M = 0 Offset = 3460 Length = 1500, M = 1 Offset = 1980

1480 + 500 = 1980

slide-14
SLIDE 14

Fragmentation at the network layer Data IP

20 1480

Data IP

20 500 Length = 520, M = 1, Offset = 1480 Length = 1500, M = 1, Offset = 0

Data IP

20 1480

Data IP

20 340 Length = 360, M = 0, Offset = 3460 Length = 1500, M = 1, Offset = 1980

Reassembly happens at the destination.

  • The M = 0 fragment gives us the total data size:

fragment offset + len(data in fragment).

  • Take fragment with smallest offset, remove header.

Add data field to datagram. Repeat until all fragments are assembled.

  • Challenges:
  • Fragments arrive out-of-order (painful, but ok)
  • Duplicate fragments (painful, but ok)
  • Missing fragments (drop the packet)
slide-15
SLIDE 15

Fragmentation at the network layer

  • Discuss: What Internet principles and characteristics

are at work in IP fragmentation?

  • Each network can have its own MTU [decentralization and heterogeneity]
  • Fragments contain complete routing information and can travel

independently of its fellow fragments [packet switching]

  • Routers can silently drop fragments without alerting the sender [best-

effort, no guarantees]

  • Reassembly is only done at the end-points [end-to-end principle and fate-

sharing]

slide-16
SLIDE 16

Fragmentation at the network layer

  • Computation and fragmentation
  • Fragmentation is expensive – memory required to hold fragments and

CPU required to split them up and put them together correctly.

  • Routers have dedicated hardware and CPUs to handle fragmentation.
  • Discuss: Fragmentation is expensive. How do we avoid it?

Assume we can set a “don’t fragment” bit on each packet.

  • MTU discovery protocol.
  • Send packets with a “don’t fragment” flag. If it doesn’t reach the

destination, the packet is too big. Reduce the packet size and try again.

slide-17
SLIDE 17

17

Today in class

1.

Recap: Network layer functions

2. 3.

Packet fragmentation IPv4 and IPv6

slide-18
SLIDE 18

No more IPv4

  • How many hosts on the Internet? About 23 billion!
  • How many IPv4 addresses? 232 (about 4.2 billion)
  • In 1980, when IPv4 was designed there were 50

universities (with a few computers each) on the Internet.

  • 31 years later, we’re almost out of IP addresses.

Region Regional Internet Registry (RIR) IPv4 Exhaustion Date Asia/Pacific APNIC April 19, 2011 Europe/Middle East RIPE September 14, 2012 South America LACNIC June 10, 2014 North America ARIN September 22, 2015 Africa AFRINIC January 2022 (Projected)

slide-19
SLIDE 19

IPv6 to replace IPv4

  • IPv6 introduced in 1998. It has 128-bit addresses!
  • 2128 (3.5x1038) different IP addresses!
  • Are we going to laugh at how small this is in 2050?
  • Probably not.
  • There are only 7.5x1018 grains of sand in the world (famous last words).
  • Address format of IPv6.
  • 8 groups of 16-bit values, separated by ‘:’
  • Leading zeroes in each group may be omitted
  • Groups of zeroes can be omitted using ‘::’
  • Examples (all are valid):
  • 2001:0db8:0000:0000:0000:ff00:0042:8329
  • 2001:0db8:0:0:0:ff00:42:8329
  • 2001:0db8::ff00:42:8329
slide-20
SLIDE 20

A redesign opportunity

  • Following the end-to-end protocol more strictly.
  • No more checksum or error detection – do it at the hosts.
  • No more fragmentation support – mandatory MTU discovery protocol.
  • Both have significant cost savings for routers.
  • But: Implementing a new network layer design is hard.
  • The whole Internet needs to upgrade!
  • All routers. All end-hosts.
  • As of June 2012: 0.2% of all global traffic was IPv6.
  • Today: 9.8% of all global traffic.
slide-21
SLIDE 21

Transitioning to IPv6

  • End-hosts are increasingly IPv6 ready, but the core is not.
  • Lesson: Getting companies to upgrade heavy-use devices without a clear

incentive will always be difficult. This is why simple changes to Internet protocols can take decades to trickle down to the real world.

Core Internet Business Network Home Network

IPv6 Ready IPv6 Ready IPv4 Only :(

IPv6 Packets

slide-22
SLIDE 22

Transitioning to IPv6

  • We can still use encapsulation to route IPv6 packets over IPv4

hardware.

  • The 6to4 protocol does this.
  • Discuss: You want an IPv6 address, but your ISP can only give

you an IPv4 address. You cant just randomly pick a IPv6 address.

  • Embed a 32-bit IPv4 inside the 64-bit IPv6 address.
  • The 6to4 protocol to extract the IPv4 is available on many IPv6 routers.
  • Let IPv6 routers know that you’re using 6to4 with “20 02:” and “:00 00”

20 02: 207. CF 2E: 46. C0 00: 192. 0000 IPv4: IPv6:

slide-23
SLIDE 23

Routing between 6to4 end-hosts

IPv4 Internet Dest: 16.79.8.0 IPv4 – 207.46.192.0 IPv6 – 2002:CF2E:C000:: IPv4 – 16.79.8.0 IPv6 – 2002:104F:0800:: Dest: 2002:104F:0800::

slide-24
SLIDE 24

Routing between a 6to4 and IPv6 end-host

IPv4 – 192.88.99.1 IPv6 – 2002:: /16 IPv4 Internet IPv6 Internet Dest: 192. 88.99.1 IPv4 – 207.46.192.0 IPv6 – 2002:CF2E:C000:: IPv6 – 1893:92:13:99:: Dest: 1893:92:13:99::

Special, anycasted IPv4 address for 6to4 Relay Routers Many ISPs provide 6to4 relay routers

slide-25
SLIDE 25

Routing between an IPv6 end-host and a 6to4 end-host

IPv4 – 192.88.99.1 IPv6 – 2002:: /16 IPv4 Internet IPv6 Internet Dest: 207.46.192.0 IPv4 – 207.46.192.0 IPv6 – 2002:CF2E:C000:: IPv6 – 1893:92:13:99:: Dest: 2002:CF2E:C000::

Use normal IPv6 routing to reach a 6to4 relay router

slide-26
SLIDE 26

Problems with 6to4 encapsulation

  • Not all ISPs have deployed 6to4 routers.
  • The few which are available are heavily overloaded and

provide poor quality of service.

slide-27
SLIDE 27

More features supported in IPv6

  • Source-based routing: Hosts can specify which routes their

packets should take.

  • IPv4 is destination based: Routes are determined by routers looking at their

tables for information about the destination IP.

  • Discuss: Potential implications of source based routing?
  • IP addresses can be associated with a device rather than a network. Every one

gets a static IP address with their device!

  • Problem: Hosts need to have end-to-end routing data.
  • Privacy options: “Host” bits of the IP address can be

randomly generated.

  • Makes it difficult to associate an IP with a host.
  • Good for one way communication channels.
  • Can support datagrams of up to 4GB!! (IPv4 does 64KB)
  • If link layer tech improves – one packet for one movie!
slide-28
SLIDE 28

Unintended negative consequences of IPv6

  • General lesson: Computer Scientists working amongst

themselves can do more damage while trying to be helpful.

  • Always work with domain experts!
  • Discuss: What could go wrong with having these features

(source-based routing, random host identifiers, 4GB datagrams)?

  • With IPv6, getting a new IP is trivial! IP blacklists are useless to stop abuse.
  • The “privacy-enhanced” option can facilitate denial-of-service attacks! Attack

from billions of easy to obtain addresses. Use random host identifiers so no legal consequences.

  • Increased ability to target specific routers for harder to detect denial of service

attacks using source routing.

  • Increased ability to willfully saturate links with 4GB datagrams to deny service

to people using the same network.

slide-29
SLIDE 29

November 6th mid-term elections!

  • Go to vote.org now!
  • 5 minutes to register to vote and find out your polling place.
  • Voter registration deadline: October 27, 2018
  • Offices up for election:
  • All Iowa executive offices (Gov, treasurer, etc). They decide UIowa budgets!
  • House of representatives (4 national + all state)
  • State senate (25)
  • Election day: November 6th
  • No lecture. Go vote!
  • In class office hours.
  • If there are financial/transport challenges in getting to your polling place, let

me know!

slide-30
SLIDE 30

Assignment 2

  • Some in-class work time.