Todays Objec3ves Networking Layers Sept 18, 2017 Sprenkle - - - PDF document

today s objec3ves
SMART_READER_LITE
LIVE PREVIEW

Todays Objec3ves Networking Layers Sept 18, 2017 Sprenkle - - - PDF document

9/18/17 Todays Objec3ves Networking Layers Sept 18, 2017 Sprenkle - CSCI325 1 Discussion What is the end-to-end argument? Sept 18, 2017 Sprenkle - CSCI325 2 1 9/18/17 Review: Applications Layering in Network Design OS


slide-1
SLIDE 1

9/18/17 1

Today’s Objec3ves

  • Networking Layers

Sept 18, 2017 1 Sprenkle - CSCI325

Discussion

  • What is the end-to-end argument?

Sept 18, 2017 Sprenkle - CSCI325 2

slide-2
SLIDE 2

9/18/17 2

Review: Layering in Network Design

  • Fundamental Ques3on: What services do

applica3ons require from the bare hardware?

Ø Don’t make each app implement the same func3onality Ø OSs should implement these services/abstrac3ons

  • Network links hand a frame to the opera3ng system
  • But what abstrac3on does the applica3on desire?
  • Do all applica3ons need the same abstrac3on?
  • What abstrac3ons do intermediate hosts (routers)

in the network need?

Sept 18, 2017 Sprenkle - CSCI325 3

Hardware OS Applications

Protocols

  • Protocol: An agreement between two “par3es” as to

how informa3on is to be transmi]ed

Ø More valuable with more users Ø How do we introduce new protocols if everyone must agree?

  • Network protocols are typically implemented in

so`ware

Ø Adds overhead to communica3on Ø Network bandwidth vs. Applica3on throughput Ø Small ma]er of code to deploy new protocol

  • Examples

Ø Internet Protocol (IP): global packet transmission/addressing Ø Transmission Control Protocol (TCP): reliable byte stream

Sept 18, 2017 Sprenkle - CSCI325 4

slide-3
SLIDE 3

9/18/17 3

The Theory: OSI (Open Systems Interconnec3on)Model

Sept 18, 2017 Sprenkle - CSCI325 5

Presenta3on Applica3on Session Transport Network Data link Physical

Ul3mate data des3na3on Format conversion Reliable, ordered delivery Rou3ng/ Internetworking Data framing

  • ver links

Bits on the wire Interac3on across presenta3on

Presenta3on Applica3on Session Transport Network Data link Physical

Web browser ASCII/XDR Restartable file transfer TCP IP Ethernet, WiFi SONET, 100BT Example Func9on

Each layer adds some more data/bits

OSI Model

Sept 18, 2017 Sprenkle - CSCI325 6

Presenta3on Applica3on Session Transport Network Data link Physical

Ul3mate data des3na3on Format conversion Reliable, ordered delivery Rou3ng/ Internetworking Data framing

  • ver links

Bits on the wire Interac3on across presenta3on Func9on

Where does security go? What about reliability?

slide-4
SLIDE 4

9/18/17 4

OSI Model Discussion

  • OSI standardized before implemented
  • On the other hand… Internet Engineering Task Force

Ø IETF philosophy: “We reject kings, presidents, and vo3ng. We believe in rough consensus and working code” Ø IETF requires two working/interoperable versions before considering a standard

  • Modular design but some boundaries are arbitrary

Ø Why seven layers? Ø What exactly is the session layer? Ø Basic network func3onality exists at mul3ple layers

Sept 18, 2017 Sprenkle - CSCI325 7

Internet Architecture

  • IP Hourglass:
  • Layering not strict

Ø Can define new abstrac3ons on any exis3ng protocol

Sept 18, 2017 Sprenkle - CSCI325 8

NFS HTTP email rlogin RPC Telecollabora3on TCP RSVP IP Ethernet ATM packet radio UDP SONET PPP air modem 100BT

slide-5
SLIDE 5

9/18/17 5

Layering in Internet Applica3ons

  • Bo]lenecks

Ø Boundary crossings Ø Copies Ø Context switches

  • Layering nice way to

logically consider protocols

Ø May not lead to fastest implementa3on Ø But! Processors are gemng faster… people are more expensive

Sept 18, 2017 Sprenkle - CSCI325 9

app socket TCP IP ether user kernel copy copy Packet arrives TCP recv hw interface sw interface task context

A li]le OS

Layering in Network Design

  • Encapsulate each layer in lower-layer format
  • Ethernet’s view of the packet:
  • IP View:
  • TCP View:

Sept 18, 2017 Sprenkle - CSCI325 10

Header Payload Header Payload Header Payload Eth Payload IP TCP HTTP

Reality:

slide-6
SLIDE 6

9/18/17 6

OSI Layering: HTTP Example

Presentation Application Session Transport Network Data link Physical Presentation Application Session Transport Network Data link Physical

Payload HTTP Payload HTTP TCP IP Payload HTTP TCP IP Payload HTTP TCP ETH Payload HTTP Payload HTTP TCP IP Payload HTTP TCP IP Payload HTTP TCP ETH

Sender Receiver

Sept 18, 2017 11 Sprenkle - CSCI325

Each protocol adds its own headers, metadata to facilitate delivery Payload: data to be sent

Communication abstraction

Datalink Layer (Layer 2): Ethernet/WiFi

  • Ethernet frame format

Preamble Dst MAC Addr Src MAC Addr Length/ Type DATA Error Check

IP Payload HTTP TCP

Sept 18, 2017 12 Sprenkle - CSCI325

slide-7
SLIDE 7

9/18/17 7

Network Layer (Layer 3): Internet Protocol (IP)

  • Service mode: best effort

Ø No guarantees about reliable, in-order, or error-free delivery Ø Enables IP to “run over anything” (e.g., any type of network)

Sept 18, 2017 Sprenkle - CSCI325 13

Version HLen TOS Length Identification Flags Offset TTL Protocol Header Checksum Source IP Addr Destination IP Addr Options (variable) Data Pad (variable)

Payload HTTP TCP

IP Address Alloca3on

  • Originally, 4 address classes

Ø A: 0 | 7 bit network | 24 bit host (1M each) Ø B: 10 | 14 bit network | 16 bit host (64K) Ø C: 110 | 21 bit network | 8 bit host (255) Ø D: 1110 | 28 bit mul3cast group #

  • Assign network # centrally, host # locally
  • W&L probably has class B address

Ø Prefix = 137.113 = 10001001. 01110001

Sept 18, 2017 Sprenkle - CSCI325 14

slide-8
SLIDE 8

9/18/17 8

End-to-End Principle Summary

  • Argument evolved into a principle
  • Idea: Keep the internet (middle) simple, end

points can be complex

Ø Right abstrac3on à Powerful!

  • IP protocol allows a variety of applica3ons to be

built on top of it

Sept 18, 2017 Sprenkle - CSCI325 15

EXAMPLE: WHAT HAPPENS WHEN YOU CLICK ON A WEB LINK?

Sept 18, 2017 Sprenkle - CSCI325 16

slide-9
SLIDE 9

9/18/17 9

What Happens When You Click

  • n a Web Link?

Sept 18, 2017 Sprenkle - CSCI325 17

Internet Your computer www.google.com www.google.com

?

Steps in Retrieving a Web Page

  • 1. Extract hostname from URL

Ø h]p://www.google.com/foo è www.google.com

  • 2. Use DNS to translate www.google.com to IP

address

Ø IP address used for Internet rou3ng Ø Result: 172.217.9.196

  • 3. Establish a TCP (socket) connec3on to

172.217.9.196

Ø Protocol agreement for browser and server to speak HTTP Ø TCP handles network problems (drops, corrup3on, etc.) Ø TCP layered on top of IP/Ethernet

  • 4. Routers determine efficient path to 172.217.9.196

Sept 18, 2017 Sprenkle - CSCI325 18

slide-10
SLIDE 10

9/18/17 10

Different Kinds of Iden3fiers

  • Domain name (e.g., www.google.com)
  • IP Address (e.g., 172.217.9.196)
  • Ethernet (e.g., 08-00-2b-18-bc-65)

Sept 18, 2017 Sprenkle - CSCI325 19

Different Kinds of Iden3fiers

  • Domain name (e.g., www.google.com)

Ø Global, human readable

  • IP Address (e.g., 172.217.9.196)

Ø Global, works across all networks Ø Some IP addrs are not global (e.g., 192.168…)

  • Ethernet (e.g., 08-00-2b-18-bc-65)

Ø Also known as the Media Access Control (MAC) addres Ø Local, works on a par3cular network Ø BUT each Ethernet address is globally unique!

Sept 18, 2017 Sprenkle - CSCI325 20

slide-11
SLIDE 11

9/18/17 11

Domain name to IP address: Domain Name System (DNS)

Sept 18, 2017 Sprenkle - CSCI325 21

Local DNS server (137.113.81.46) What’s the IP address for www.google.com? Your computer (137.113.118.200) Oh, you can find it at 172.217.9.196 But how do we know how to find 137.113.81.46?

How Do We Know Our DNS Server?

  • IP cannot be configured into hosts when they are

manufactured

  • DHCP (Dynamic Host Configura3on Protocol) allows

for dynamic assignment of IP addresses

Ø Admins don’t need to manually configure hosts

  • When host needs config info, broadcast

DHCPDISCOVER

Ø DHCP server responds with IP address, Router’s IP address, and DNS server address

  • But we s3ll need to know the MAC address in order

to communicate

Ø need to get to the lowest layer

Sept 18, 2017 Sprenkle - CSCI325 22

slide-12
SLIDE 12

9/18/17 12

IP address to MAC Address: Address Resolu3on Protocol (ARP)

Sept 18, 2017 Sprenkle - CSCI325 23

Ethernet Broadcast: Anyone know the Ethernet address for 137.113.81.46? Ethernet Unicast: Yes, I’m at 08-00-2b-18-bc-65 (137.113.118.200) (137.113.81.46)

Same IP prefix: 137.113

Ethernet addresses are only helpful on our local network. Matching IP address prefixes tell us that we are on the same network!

Finding Google

  • 1. Know Google’s IP address

Ø Update IP header of our packet with correct des3na3on IP address

  • 2. Google’s IP address prefix doesn’t match our IP

address prefix

Ø We are NOT on the same network

  • 3. We must go through our gateway router

Ø Router will pass our packet out to the Internet

  • 4. Update Ethernet address of our packet so that

des3na3on Ethernet addr is the address of our router

Ø IP address never changes!

Sept 18, 2017 Sprenkle - CSCI325 24

slide-13
SLIDE 13

9/18/17 13

How Does a Packet Get Through the Internet?

Sept 18, 2017 Sprenkle - CSCI325 25

R R R R R

H H H H

R R

H

R

Routers send packet to next closest point H: Hosts R: Routers Each router uses IP prefix matching to get our packet one step closer to Google. Dest Ethernet addr in packet gets updated with each hop! Dest IP addr never changes…

172.217.9.196 137.113.118.200

How Do Routers Know Where to Send Data?

  • Forwarding tables at each router
  • Original Internet: manual update
  • Today: automa3c update based on “cost”

Ø Link State Protocol

  • Broadcast local connec3vity informa3on throughout

the network

  • Maintain table of cost to get to other des3na3ons
  • Choose path with smallest cost

Sept 18, 2017 Sprenkle - CSCI325 26

slide-14
SLIDE 14

9/18/17 14

Link State Example

  • Flood following informa3on through the network

Ø A: (AàC,1) (AàB,1) Ø B: (BàA,1) (BàC,4) Ø C: (CàA,1) (CàB,4) (CàD,2) Ø D: (DàC,2) (DàE,3) Ø E: (EàD,3)

  • Each host runs Dijkstra’s algorithm to find shortest path to all
  • ther hosts

Sept 18, 2017 Sprenkle - CSCI325 27

A B C D E 1 4 1 2 3

Why Do We Need All Three?

  • Domain name (e.g., www.google.com)

Ø Global, human readable

  • IP Address (e.g., 74.125.91.147)

Ø Global, works across all networks Ø Some IP addrs are not global (e.g., 192.168…)

  • Ethernet (e.g., 08-00-2b-18-bc-65)

Ø Also known as the Media Access Control (MAC) addres Ø Local, works on a par3cular network Ø BUT each Ethernet address is globally unique!

Sept 18, 2017 Sprenkle - CSCI325 28

slide-15
SLIDE 15

9/18/17 15

Why Do We Need All Three?

  • Domain name (e.g., www.google.com)

Ø Humans remember

  • IP Address (e.g., 74.125.91.147)

Ø Rou3ng Ø Can’t be assigned by manufacturer

  • Ethernet (e.g., 08-00-2b-18-bc-65)

Ø Assigned by manufacturer Ø Used locally

Sept 18, 2017 Sprenkle - CSCI325 29

Have Address, Now Send Data

  • So now we know how to find Google and send data
  • Real networks must deal with conges3on, bit errors, etc.

that occur during data transmission

Ø Data can be corrupted Ø Data can get lost Ø Data might not fit in a single packet Ø Data can be delivered in the wrong order Ø …

Sept 18, 2017 Sprenkle - CSCI325 30

slide-16
SLIDE 16

9/18/17 16

What If the Data Gets Corrupted?

Sept 18, 2017 Sprenkle - CSCI325 31

Internet GET iex.html GET index.html IP TCP Data

TCP Packet Format

sequence number acknowledgement number source port destination port window size

reserved

header length

U R G A C K P S H R S T S Y N F I N

15 16 TCP checksum urgent pointer

  • ptions (if any)

data (if any) 31 20 bytes

Solution: Add a checksum

What If the Data Gets Lost?

Sept 18, 2017 Sprenkle - CSCI325 32

Internet GET index.html Solution: Timeout and retransmit Internet GET index.html GET index.html wait a bit, retry GET index.html No ACK that data was received

slide-17
SLIDE 17

9/18/17 17

What If the Data Does Not Fit in a Single Packet?

Sept 18, 2017 Sprenkle - CSCI325 33

On Ethernet, max IP packet size is 1.5kbytes Typical web page is 10kbytes GET inde x.ht ml GET index.html Solution: Fragment data across packets

What If the Data is Out of Order?

Sept 18, 2017 Sprenkle - CSCI325 34

GET x.th inde ml GET x.thindeml ???

Solution: Add sequence numbers

GET index.html ml 4 inde 2 x.th 3 GET 1

slide-18
SLIDE 18

9/18/17 18

What If Network is Overloaded?

  • Data can arrive at router faster than it can be forwarded
  • Short bursts: buffer at router
  • What if buffer overflows?

Ø Packets dropped and retransmi]ed Ø Sender adjusts rate un3l load matches available resources

  • Called “Conges3on control”

Ø Broadcast network (Ethernet): bus arbitra3on Ø Wide-area networks: typically handled by TCP Ø Necessary for global fairness, but in the interests of individuals to ignore

Sept 18, 2017 Sprenkle - CSCI325 35

Looking Ahead

  • Internet Services – Friday
  • Wed: Threads and Synchroniza3on
  • Web Server Implementa3on

Sept 18, 2017 Sprenkle - CSCI325 36