Computer Networking
Febriliyan Samopa
Objectives
• Understand the state-of-the-art in network
protocols, architectures and applications
• Understand how networking research is
done
• Teach the typical constraints and thought
process for networked systems
• How is class different from undergraduate
networking
• Training network programmers vs. training
network researchers
2
Network Paradigm
• Why we need network ?
• What is the problem that the only solution is
network ?
The answer to both question is SHARING
3
What is the Objective of Networking?
• Communication between applications on
different computers
• Must understand application
needs/demands
• Traffic data rate
• Traffic pattern (bursty or constant bit rate)
• Traffic target (multipoint or single destination,
mobile or fixed)
• Delay sensitivity
• Loss sensitivity
4
Four Steps to Networking
• Communicating across a link
• Connecting together multiple links
(internetworking)
• Finding and routing data to nodes on
internetwork
• Matching application requirements
5
A First Step
• Creating a link between nodes
• Link: path followed by bits
• Wired or wireless
• Photon or electron
• Broadcast or point-to-point (or both)
• Node: any device connected to a link
6
Link Model
• A link model consist of a transmitter that
connected to a receiver by a medium.
• A Transmitter : a node that sends data.
• A Receiver : a node that accept data.
Trans Medium Recei
mitter ver
7
Electrical Model
• The transmitter acts as a voltage source in
the close circuit.
• The medium acts as a resistance from
transmitter to receiver and vice versa.
• The receiver acts as a load in closed circuit
• The transmitter will generate series of
voltage (signal) according to the data sends
and arrive in the receiver as series of
voltage that less than the original voltage.
8
Electrical Model
Medium
Trans Medium Recei Sour
Load
mitter ver ce
Medium
Link Model Electrical Model
R1 UTP Cable
VS R2 VL
R3
VS : Source Voltage
VL : Load Voltage = Voltage between R2 = Voltage arrived at Receiver
R2 : Resistance of Load BNC Cable
R1, R3 : Resistance of Medium
if medium is symmetric (i.e. UTP Cable) then R1 = R3
if medium is asymmetric (i.e. BNC Cable) then R1 ≠ R3
9
Electrical Model
R1 Serial Circuit :
• The current (I) is constant.
VS R2 VL • VS = I x (R1 + R2 + R3)
• VL = I x R2
R3 • Power transmitted by Source (PS) = VS x I
• Power received by Load (PL) = VL x I
• Efficiency (E) = Power received / Power transmitted
= PL/ PS
= (VL x I) / (VS x I) = VL / VS
= (I x R2) / (I x (R1 + R2 + R3))
= R2 / (R1 + R2 + R3)
R1 = (ρ1 / a1) x l
R3 = (ρ3 / a3) x l
ρ = Resistivity, a fundamental property of a material that quantifies how strongly it
resists electric current, constant value, depends on material used as medium.
a = Cross-sectional area of the medium, usually constant value for a particular
medium.
l = Length of the medium.
10
Electrical Model
• If the power arrived at receiver (PL) is less than the power
tolerance, the signal cannot be read by the receiver.
• For example, if the tolerance allowed in ethernet is 10%,
then the link will be down (signal can’t be read by receiver)
when efficiency is less than 90% (E < 0.9).
• In the example above, the link will be up if efficiency is
greater than or equal 90% (E ≥ 0.9).
• The value of R2 (load resistance) for a certain technology
is constant and the value of (ρ/a) for a certain media is
constant so :
R1 = (ρ1 / a1) x l ➔ R1 = c1 x l; R2 = (ρ2 / a2) x l ➔ R2 = c2 x l
this means that the only variabel that determine the
efficiency is the length of medium (distance between
sender and receiver). 11
Packet Transmission Modes
• Unicast
• Transmission to single specific receiver
• Broadcast
• Transmission to all network nodes
• Multicast
• Transmission to specific subset of nodes
• Anycast
• Transmission to one of a specific subset of
nodes
12
Types of Links
Point-to-Point Multiple Access
13
What are Switched Networks?
• Switch: moves bits Switched Network
between links
• Packet switching
• Circuit switching
14
Back in the Old Days…
15
Then Came TDM…
• Synchronous time division multiplexing
Multiplex (mux) Demultiplex (demux)
16
TDM Logical Network View
17
TDM Variety
• Frequency Division Multiplexing (FDM)
• Code Division Multiplexing (CDM)
18
Packet Switching (Internet)
Packets
19
Packet Switching
• Interleave packets from different sources
• Efficient: resources used on demand
• Statistical multiplexing
• General
• Multiple types of applications
• Accommodates bursty traffic
• Addition of queues
20
Statistical Multiplexing Gain
• 1 Mbps link; users require 0.1 Mbps when
transmitting; users active only 10% of the
time
• Circuit switching: can support 10 users
• Packet switching: with 35 users, probability
that >=10 are transmitting at the same time
< 0.0017
21
Characteristics of Packet Switching
• Store and forward
• Packets are self contained units
• Can use alternate paths – reordering
• Contention
• Congestion
• Delay
22
Second Step: Internet[work]
• A collection of Internet[work]
interconnected
networks
• Host: network
endpoints (computer,
PDA, light switch, …)
• Router: node that
connects networks
• Internet vs. internet
23
Challenge
• Many differences between networks
• Address formats
• Performance – bandwidth/latency
• Packet size
• Loss rate/pattern/handling
• Routing
• How to translate between various network
technologies
24
Third Step: How To Find Nodes?
Internet
Computer 1 Computer 2
25
Naming
• Humans use readable host names
• E.g. www.cmu.edu
• Globally unique (can correspond to multiple
hosts)
• Naming system translates to physical
address
• E.g. DNS translates name to IP Address (e.g.
128.2.11.43)
• Address reflects location in network
26
Domain Name System
What’s the IP address for www.cmu.edu?
It is 128.2.11.43
Computer 1 Local DNS Server
DNS server address manually configured into OS
27
Packet Routing/Delivery
• Each network technology has different local
delivery methods
• Address resolution provides delivery
information within network
• E.g., ARP maps IP addresses to Ethernet
addresses
• Local, works only on a particular network
• Routing protocol provides path through an
internetwork
28
Network:Address Resolution Protocol
Broadcast: who knows the
Ethernet address for 128.2.11.43?
Ethernet
Unicast: Yes, it is
08-00-2c-19-dc-45
Ethernet
29
Internetwork: Datagram Routing
Routers send
packet to next
closest point H R
H
R R
H
R
H
R
R H: Hosts
H R: Routers
30
Routing
• Forwarding tables at each router populated by
routing protocols.
• Warning: Routed vs Routing Protocols
• Routed Protocols used between routers to direct user’s
traffic. Examples: IP, IPX
• Routing Protocols used only between routers to
maintain tables. Examples: RIP, OSPF, BGP.
• Original Internet: manually updated
• Routing protocols update tables based on “cost”
• Exchange tables with neighbors or everyone
• Use neighbor leading to shortest path
31
Fourth Step: Application Demands
• Reliability
• Corruption
• Lost packets
• Flow and congestion control
• Fragmentation
• In-order delivery
• Etc…
32
What if the Data gets Corrupted?
Problem: Data Corruption
GET index.html GET windex.html
Internet
Solution: Add a checksum
0,9 9 6,7,8 21
X
4,5 7 1,2,3 6
33
What if the Data gets Corrupted?
Sophisticated Solution: Add a CRC
X
6,7,8 CRC Code 1,2,3 CRC Code
34
What if Network is Overloaded?
Problem: Network Overload
Solution: Buffering and Congestion Control
• Short bursts: buffer
• What if buffer overflows?
• Packets dropped
• Sender adjusts rate until load = resources
• Called “congestion control”
35
Dropping Packets
• There are two methods exist
• WINE Methods
• The Idea : An older wine is better than the fresh one
• This methods will drop packets starting from the
youngest until the congestion is relieved
• MILK Methods
• The Idea : A fresh milk is better than the old one
• This methods will drop packets starting from the
oldest until the congestion is relieved
36
What if the Data gets Lost?
Problem: Lost Data
GET index.html
Internet
Solution: Timeout and Retransmit
GET index.html
GET index.html
Internet
GET index.html
37
What if the Data Doesn’t Fit?
Problem: Packet size
• On Ethernet, max IP packet is 1.5kbytes
• Typical web page is 10kbytes
Solution: Fragment data across packets
ml x.ht inde GET
GET index.html
38
What if the Data is Out of Order?
Problem: Out of Order
ml inde x.ht GET
GET x.htindeml
Solution: Add Sequence Numbers
ml 4 inde 2 x.ht 3 GET 1
GET index.html
39
Network Functionality Summary
• Link
• Multiplexing
• Routing
• Addressing/naming (locating peers)
• Reliability
• Flow control
• Fragmentation
• Etc….
40
What is Layering?
• Modular approach to network functionality
• Example:
Application
Application-to-application channels
Host-to-host connectivity
Link hardware
41
Protocols
• Module in layered structure
• Set of rules governing communication
between network elements (applications,
hosts, routers)
• Protocols define:
• Interface to higher layers (API)
• Interface to peer
• Format and order of messages
• Actions taken on receipt of a message
42
Layering Characteristics
• Each layer relies on services from layer
below and exports services to layer above
• Interface defines interaction
• Hides implementation - layers can change
without disturbing other layers (black box)
43
Layering
User A User B
Application
Transport
Network
Link
Host Host
Layering: technique to simplify complex systems
44
Layer Encapsulation
User A User B
Get index.html
Connection ID
Source/Destination
Link Address
45
Protocol Demultiplexing
• Multiple choices at each layer
FTP HTTP NV TFTP
TCP UDP
Network IP TCP/UDP
IPX IP
Type Protocol Port
Field Field Number
NET1 NET2 … NETn
46
E.g.: OSI Model: 7 Protocol Layers
• Physical: how to transmit bits
• Data link: how to transmit frames
• Network: how to route packets
• Transport: how to send packets end2end
• Session: how to tie flows together
• Presentation: byte ordering, security
• Application: everything else
47
The Transport Layer
• The transport layer “DIRECTS PACKETS”,
splits it up into smaller units if need be,
pass these to the network and ensure that
the pieces are traveling in an orderly
fashion.
• A series of protocols are also established in
this layer to ensure proper flow of the
packets.
• You can basically describe the Transport
Layer as a “TRAFFIC COP”.
48
The Session Layer
• The session layer allows different machines
to establish sessions between themselves.
• Once communications are established,
encryption then begins both parties.
49
The Presentation Layer
• The Presentation Layer’s job is managing data
structures and converting from the representation
used inside the computer to the network standard
representation an visa versa.
• In English terms, the Presentation layer basically
takes the packets and re-assembles them so you
can open the e-mail or the attachment.
• If any packets got lost along the way, or were
damaged, then the Presentation layer will send a
sign to the sender that it requires the specific
packet.
50
The Application Layer
• The Application layer contains a variety of
protocols that are commonly required.
• One of Application layer function is file
transfer.
• Different file systems have different file
naming conventions, different ways of
representing text lines, and so on.
• Transferring a file between two different
systems requires handling and other
incompatibilities.
51
OSI Layers and Locations
Application
Presentation
Session
Transport
Network
Data Link
Physical
Host Switch Router Host
52
Example: Transport Layer
• First end-to-end layer
• End-to-end state
• May provide reliability, flow and congestion
control
53
Example: Network Layer
• Point-to-point communication
• Network and host addressing
• Routing
54
Is Layering Harmful?
• Sometimes..
• Layer N may duplicate lower level functionality
(e.g., error recovery)
• Layers may need same info (timestamp, MTU)
• Strict adherence to layering may hurt
performance
55