Note: We will start at 12:53 pm ET
à
18-441/741: Computer Networks Lectures 3: Layers II & PHY I
Swarun Kumar
2
Layer Encapsulation
User A
User B
Get index.html
Connection ID
Source/Destination Link Address
3
Multiplexing and Demultiplexing
TCP TCP
IP IP
• There may be multiple implementations of each layer.
– How does the receiver know what version of a layer to use?
• Each header includes a demultiplexing field that is used to identify the next layer.
– Filled in by the sender – Used by the receiver
• Multiplexing occurs at multiple layers. E.g., IP, TCP, …
V/HL
TOS
Length
ID
Flags/Offset
TTL
Prot.
H. Checksum
Source IP address
Destination IP address
Options..
4
Protocol Demultiplexing
• Multiple choices at each layer
FTP
TCP
HTTP
NV
UDP
TFTP
Network
IP
TCP/UDP
IPX
IP
Type Protocol Port Field Field Number
NET1
…
NET2
NETn
5
Server and Client
Server and Client exchange messages over the network through a common Socket API
Server
ports
Socket API
user space
Clients
TCP/UDP
TCP/UDP
kernel space
IP
IP
Ethernet Adapter
Ethernet Adapter
hardware
6
The Internet Protocol Suite
FTP
TCP
Applications UDP TCP
Data Link Physical
HTTP
NV
TFTP
UDP
IP
Narrow Waist
NET1
…
NET2
NETn
The Hourglass Model
The waist facilitates interoperability … but evolution is hard
7
IP based on a Minimalist Approach
• Dumbnetwork
– IP provide minimal functionalities to support connectivity
• Addressing, forwarding, routing • Smartendsystem
– Transport layer or application performs more sophisticated functionalities
• Flow control, error control, congestion control
• Advantages
– Accommodate heterogeneous technologies (Ethernet, modem, satellite, wireless)
– Support diverse applications (telnet, ftp, Web, X windows)
– Decentralized network administration
8
Sample Quiz Question
• Question: Which of these will be hardest launch at Internet-scale:
[Option A] a new version of TCP, [Option B] a new version of IP [Option C] or a new version of WiFi
• Answer: New IP (why?)
9
Today’s Lecture
• Network applications
– Requirements
– Latency and bandwidth
• Internet architecture – A layered design
– Protocols
– Life of a packet
• Network utilities
10
Protocol Stack (cotd.)
• Network applications
– Requirements
– Latency and bandwidth
• Internet architecture – A layered design
– Protocols
– Life of a packet
• Network utilities
11
Network tools
• ping
• traceroute • ipconfig
• tcpdump •…
12
ping
• Application to determine if host is reachable
• Based on Internet Control Message Protocol
– ICMP informs source host about errors encountered in IP packet processing by routers or by destination host
– ICMP Echo message requests reply from destination host
• PING sends echo message & sequence #
• Determines reachability & round-trip delay
• Sometimes disabled for security reasons
traceroute
• Findroutefromlocalhosttoaremotehost
• Time-to-Live(TTL)
– IP packets have TTL field that specifies maximum # hops traversed before packet discarded
– Each router decrements TTL by 1
– When TTL reaches 0 packet is discarded
• Traceroute
– Send UDP to remote host with TTL=1
– First router will reply ICMP Time Exceeded Message – Send UDP to remote host with TTL=2, …
– Each step reveals next router in path to remote host
• tracert (windows), tracepath (linux)
ipconfig
• Utility in Microsoft Windows to display TCP/IP information about a host
• Many options
– Simplest: IP address, subnet mask, default gateway for the host
– Information about each IP interface of a host
• DNS hostname, IP addresses of DNS servers, physical address of network card, IP address, …
– Renew IP address from DHCP server
19
netstat
• Queries a host about TCP/IP network status
• Status of network drivers & their interface cards
– #packets in, #packets out, errored packets, …
• State of routing table in host
• TCP/IP active server processes
• TCP active connections
tcpdump and Network Protocol Analyzers
• tcpdump program captures IP packets on a network interface (usually Ethernet NIC)
• Filtering used to select packets of interest
• Packets & higher-layer messages can be displayed and analyzed
• tcpdump basis for many network protocol analyzers for troubleshooting networks
• We use the open source Ethereal analyzer to generate examples (or wireshark, etc.)
– www.ethereal.com
How the layers work together: Network Analyzer Example
Internet
l User clicks on http://www.nytimes.com/
l Ethereal network analyzer captures all frames observed
by its Ethernet NIC (or Wireshark)
l Sequence of frames and contents of frame can be examined in detail down to individual bytes
Top Pane shows frame/packet
Middle Pane shows encapsulation for a
sequence
given frame
Ethereal windows
Bottom Pane shows hex & text
Top pane: frame sequence
DNS Query
TCP Connection Setup
HTTP Request & Response
Middle pane: Encapsulation
Ethernet Frame
Protocol Type
Ethernet Destination and Source Addresses
IP Source and Destination Addresses
Middle pane: Encapsulation
And a lot of other stuff!
IP Packet
Protocol Type
Source and Destination Port Numbers
GET
Middle pane: Encapsulation
TCP Segment
HTTP Request
Goals [Clark88] 0 Connect existing networks
initially ARPANET and ARPA packet radio network
1. Survivability
ensure communication service even in the presence of network and router failures
2. Support multiple types of services
3. Must accommodate a variety of networks 4. Allow distributed management
5. Allow host attachment with a low level of effort
6. Be cost effective
7. Allow resource accountability
29
Principle: End-to-End Argument (Saltzer’81)
• Focusofthepaperis“system” – Not a pure networking paper
• Dealswithwheretoplacefunctionality – Inside the network (in switching elements) – At the edges
• Argument:Somefunctionscanonlybe correctly implemented by the endpoints – do not try to implement these elsewhere
– Not a law – more of a “best practices”
30
Example: Reliable File Transfer
Host A
Host B
Appl.
OS
Appl.
OS
OK
• Solution 1: make each step reliable, and then concatenate them
• Solution 2: end-to-end check and retry
31
Sample Quiz Question
• Question: A switch and a router both cost $100 and have similar specs and achieve similar performance in packet switching/routing. As a rational buyer, I would buy the router. [True/False]
• Answer: True, the router (why?)
32
Life of Packet
Application
Presentation Session Transport Network
Data Link Physical
Host Bridge/Switch
Router/Gateway Host
33
Physical Layer (PHY) – I
34
Physical Layer: Outline
• Digitalnetworking
• Modulation
• CharacterizationofCommunicationChannels
• FundamentalLimitsinDigitalTransmission
• ModemsandDigitalModulation
• LineCoding
• PropertiesofMediaandDigitalTransmission Systems
• ErrorDetectionandCorrection
35
Digital Networks
• Digitaltransmissionenablesnetworksto support many services
TV
E-mail
Telephone
36
Analog versus Digital Information
• Analoginformationtakesoncontinuous values
– Sound, images, etc.
• Digitalinformationtakesondiscretevalues – Text, banking data, etc.
• Canconvertbetweenthetworepresentations of information
– Sampling and interpolation
37
Block vs. Stream Information
Block
• Information that occurs in a single block
– T ext message
– Data file
– JPEG image
– MPEG file
• Size = bits / block
or Bytes/block
– 1 KByte (KB) = 210 bytes
– 1 MByte (MB) = 220 bytes
– 1 GByte (GB) = 230 bytes
Stream
• Information that is produced & transmitted continuously
– Real-time voice
– Streaming video
• Bit rate = bits / second – 1Kbps =103 bps
– 1Mbps=106 bps
– 1Gbps=109bps
38
Many Types of Information
Stream Block
Analog Digital
Voice, video
Stock market
Images, radar map, …
Spreadsheets, text file, …
39
Traditional Communication Options
• Sendanaloginformationoveranalog networks
– Voice over the telephone network – Video using broadcast TV
– Pictures using the USPS
• Senddigitalinformationoverdigitalnetworks
– Messages via telegraph: beacons … electrical
– Internet: many applications, e.g., http, (text) email, ssh, social networks, …
40
But Can Mix and Match
• Analog information can be digitized and sent over digital network
– Video becomes MPEG – Image becomes JPEG
• Digital networks use analog channels – Bits are encoded on analog waveforms – But switching is done based on the bits
41
JPEG
Modem
JPEG
Modem
Example
IP Telephone Network Optical Backbone
42
Why Use a Single Digital Network?
• Economicallyadvantageoustohaveasingle network
• Multimediaapplicationswanttomixdifferent types of data
– More convenient if a single networks is used
• Computersoperateonlyondigitaldata
• Digitaltransmissioncanrecoverfromerrors (e.g. noise, distortion)
– Not possible when transmitting analog information over an analog network
43
Sent
Distortion Attenuation
Received
Analog Transmission
All details must be reproduced accurately
44
Why digital? Problem with Analog Long- Distance Communications
Transmission segment
. . . Destination
• Eachrepeaterattemptstorestoreanalogsignalto
its original form
• Restorationisimperfect
– Distortion is not completely eliminated
– Noise & interference is only partially removed
• Signalqualitydecreaseswith#ofrepeaters
• Communicationsbecomesdistance-limited
• StillusedinanalogcableTVsystems
• Analogy: Copy a song using a cassette recorder
Source
Repeater
Repeater
45
Sent
Distortion Attenuation
Received
Digital Transmission
Only discrete levels need to be reproduced
Simple Receiver: Was original pulse positive or negative?
46
Digital Long-Distance Communications
Transmission segment
Regenerator
. . .
Destination
Source
Regenerator
• Regenerator recovers original data sequence and retransmits on next segment
• Can design so error probability is very small
• Then each regeneration is like the first time!
• Analogy: copy an MP3 file
• Communications is possible over very long distances
• Digital systems advantage over analog systems
– Less power, longer distances, lower system cost
– Monitoring, multiplexing, coding, encryption, protocols…
47