a network of interconnected objects the tcp/ip...
TRANSCRIPT
Lecture 1
A Network of Interconnected ObjectsThe TCP/IP stack
Part of the material used for this slides has been obtained from:Computer Networking: A Top Down Approach , 4th edition. Jim Kurose, Keith Ross. Addison-Wesley, July 2007.
Starting Point
Wireless Networks as an
Access Technology to
Internet
“Internet Protocol (IP) everywhere”
Mobile Communication Networking
Mobile Internet Applications
IMS
SIP
TCP/UDP
IP
TCP/UDP
LINK
PHY
WLANs
Johan Zuidweg (4th part)
Miquel Oliver (3rd part)
Anna Sfairopoulou (2nd part)
Boris Bellalta (1st part)
What's the Internet
• Millions of connected computing devices: • Hosts = end systems running
network applications• Routers / Switches = network
elements
What's the Internet: a service view
→ The Network provides communication services to applications. → The different services are characterized by their capability to provide:
● Data loss ● Timing (delay)● Throughput ● Security
→ What services provide the current Internet?● IP is a besteffort (there are no loss & delay guarantees)● A reliable service (based on TCP)● A nonreliable service (based on UDP)
10
Types of Traffic vs User perception● Elastic flows (TCPbased): use all the available bandwidth, fair.
● Streaming/Rigid flows (UDPbased): use only the required bandwidth.
Rigid Traffic (UDP)
User Perception
B
B
Video/audio streaming Voice over IP
Web (HTTP) FTP, email, ...
Multimedia
Elastic Traffic (TCP)User Perception
MinimumBandwidth
Good
Bad
Better
Worst
Circuit switching● At each link between the source and destination a portion of
bandwidth is reserved for that communication (data transfer).
● Before to start the communication, the circuit must be established (e.g. mobile phone call).
● Benefits:
● Once the circuit is created, the communication does not suffer any “interference” from other communications.
● Disadvantages:
● Very low efficiency (if there is no data to be transmitted, nobody can take profit of the reserved bandwidth).
● Low network capacity.
Packet switching● There is no bandwidth reservation at any link between the
source and destination.
● All decision (routing to next hop) are taken based on each individual “packet”.
● Benefits:
● Simple, does not require any extra signaling.● Better use of the transmission resources Higher capacity.→
● Disadvantages:
● Unpredictable network performance (for each communication) as it depends on the behavior of the others.
Packet switching
A “packetizer” function encapsulates (adds the necessary headers) a sequence of bits in a “packet”.The overall packet has length of L (data + header) bits.
Codec Packetizer
bitsvoice packets
t1 2 3
L bits
Time beetwen packets
File10
MBytesPacketizer
packets
t1 2 3
L bits
bits
streaming flow
elastic flow
Packet switching
Access Point
PC
Web Server
VoIP/WLANphone
VoIP/WLANphone
Router A
Switch
ADSL/Switch
Router C
Router B
VoIP phone
Network elements forward packets to its destination through other network elements (routing).
End points (final systems) generate the data.
Optical Fiber links
Internet: a network of queues
Access Point
PC
Web Server
VoIP/WLANphone
VoIP/WLANphone
Router A
Switch
ADSL/Switch
Router C
Router B
HTTP request
HTTP response
HTTP request Web Server
PC clientsHTTP response
Router A Router B Router C
Router C Router B
Request delay? Response delay?
Queue
If the link is full, packets have to wait its turn in a queue!!!!
17
Endtoend vs Hop by Hop retransmissions
1 2 5
Data
ACK/NAK
Endtoend
1 2 5
Data
ACK/NAK
Hopbyhop
3
Data
ACK/NAK4
Data
ACK/NAK
Data
ACK/NAK
3
Data
4
Data Data
What is a protocol?
● network protocols: between objects (machines) all communication activity in Internet is governed by protocols
● protocols define format, ● order of msgs sent and received among network
entities, ● actions taken on msg transmission, receipt
TCP/IP protocol stack
application: supporting network applicationsFTP, SMTP, HTTP
transport: processprocess data transferTCP, UDP
network: routing of datagrams from source to destination IP, routing protocols
link: data transfer between neighboring network elements Ethernet, WLANs
physical: wired / wireless
Internet Protocol Stack
application: supporting network applicationsFTP, SMTP, HTTP
transport: processprocess data transferTCP, UDP
network: routing of datagrams from source to destination IP, routing protocols
link: data transfer between neighboring network elements Ethernet, WLAN
physical: bits “on the wire/wireless”
Link Layer● Frame transfer between two directly connected (1 hop) node.
● The services provided at the link layer depend on the specific linklayer protocol that is employed over the link.
24
Data Link Layer functions●Link Layer
– Hoptohop addressing
– Framing
– Error control (detection and correction)
– Retransmissions and flow control● Reduce errors.● Flow control (avoid to saturate the receiver).
– Medium Access Control●PHY Layer
– Transmission / Reception
25
Why addresses? Address = identifier
Layer2 address: Broadcast medium: to identify the sender and destination nodes.
Pointtopoint: not required
0A:1C:2E:AA:02:55
0A:1C:2E:AA:04:25
B1:CB:11:A0:25:11
All nodes will inspect the destination address before to discardor to process the received packet.
26
Segmentation & Reassembly
To accommodate arbitrary message size, a layer may have to deal with messages that are too long or too short for its protocol➔ Segmentation & Reassembly: a layer breaks long messages
into smaller blocks and reassembles these at the destination
1 long message
2 or more blocks
2 or more short messages
1 block
27
Error Control and Detection
Let assume:Pb – Probability of bit error F – Frame size in bits
Pr{no errors}= (1 Pb)F
Pr{one or more bits in error} = 1 (1 Pb)F
Example:
Pb = 106, F = 8*1500 bitsPr {Frame error} = 1 – (1106) 8*1500 = 1.2*102
28
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking, may include header fields
● error detection not 100% reliable!● protocol may miss some errors, but rarely● larger EDC field yields better detection and correction
otherwise
29
Automatic Repeat Request (ARQ)Purpose: to ensure a sequence of information packets is delivered in “order” and without errors or duplications despite transmission errors & losses
● Three basic schemes: StopandWait ARQ GoBack N ARQ Selective Repeat ARQ
● Basic elements of ARQ: Errordetecting code with high error coverage ACKs (positive acknowledgments NAKs (negative acknowlegments) Timeout mechanism
30
Automatic Repeat Request (ARQ)Efficiency and other metrics: computed in fullduplex channels.
● Different channels from Tx to Rx and from Rx to Tx.
● Selective Repeat is the most efficient.
Real broadcast systems: halfduplex channel. There is no possibility to transmit simultaneously in both cases.
– Stop & Wait option becomes the unique solution.
Improvements: Block transmissions with Stop & Wait ARQs, Piggybacking, HybridARQs...
f
C [bps]
f
C [bps]
Data and ACKs in the same bandwidth Data and ACKs in separated channels
31
ARQ: Stop & Wait
time time
Sender Receiver
ACK
Packet
In this case:Same propagation delay. Why?Different transmission delay. Why?
Multiuser Environments● A group of stations share the communication medium
● Broadcast networks
● Each transmission is received by all the stations
● Circuitswitching (TDM) vs Packetswitching (e.g. random access).
The packets are distributed in different nodes... which complicates the MAC...
33
Multiple Access protocols● Single shared broadcast channel ● Two or more simultaneous transmissions by nodes: interference
● collision if node receives two or more signals at the same time
multiple access protocol (MAC)● Coordinates the access to the shared medium● Defines when and how the stations should transmit
● Performance: Depending on the technique used the performance of the network differs.
● Metrics: Total number of packets/s, delay, reliability, cost, max. number of stations, etc.
Static Channelization
● Bandwidth allocation: Give a portion of the shared medium to each user
● Highly efficient for constantbit rate traffic● Examples:
FDMA
● Divide channel into M frequency bands● Each station transmits and listens on assigned
bands● Each station transmits at most C/M bits/s
TDMA
● Dedicate 1 slot per station in transmission cycles
● Each station transmits at C bps 1/M of the time
Random Access
● When a node transmits uses all the available bandwidth
● If more than one node transmit at the same time a collision occurs
● Random access protocols
● Determine the way nodes access the channel and share it
● Minimize and specify how to recover from collisions
SAloha Performance
G
S
● High performance increase compared with Aloha.
● At which cost?? Synchronization is needed
SAloha
Aloha
CSMA Performance
G
S
● The performance depends on the propagation time
● Better than Aloha for low propagation times
46
“Reservation” MAC protocols
channel partitioning MAC protocols:● share channel efficiently and fairly at high load● inefficient at low load: delay in channel access, 1/N
bandwidth allocated even if only 1 active node!
Random access MAC protocols● efficient at low load: single node can fully utilize channel● high load: collision overhead
“taking turns” protocols● look for best of both worlds!
Internet Protocol Stack
application: supporting network applicationsFTP, SMTP, HTTP
transport: processprocess data transferTCP, UDP
network: routing of datagrams from source to destination IP, routing protocols
link: data transfer between neighboring network elements Ethernet, WLAN
physical: bits “on the wire/wireless”
Network Layer
forwardingtable
Routing protocols path selection RIP, OSPF, BGP
IP protocol addressing conventions datagram format packet handling conventions
ICMP protocolerror reportingrouter “signaling”
Transport layer: TCP, UDP (reliability, flow control)
Link layer (node-to-node communication)
Physical layer (bits coding and modulation)
Networklayer
Network layer● The network layer receives a data segment from transport● Network layer encapsulates the data segments into datagrams● All routers have a network layer, they check the datagram and
route it according to its destination
Internet Protocol (IP) is the worldwide used as network protocol
applicationtransportnetworkdata linkphysical
networkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
segment
Sending hostReceiving host
datagram
datagram
datagram
data
gram
Network functions
1. routing: determine route taken by packets from source to dest. (routing algorithms)
2. forwarding: move packets from router’s input to appropriate router output
Addressing
● Address: “interface” unique identifier.
● Network address: Network “interface” identifier.
● A node can have multiple interfaces.
● Each interface has a linklayer and a network layer address:
networklayer (logical or IP) address:11000001100100010011100000001111 Binary: 32 bits
www.upf.eduName (easy for humans)
Decimal with dots 4 numbers dot separated 193.145.56.15
linklayer (MAC or physical) address: 0016EA2EC584
Routing: Motivation
How to route the packet along the network:
Several ways to reach the destination, but which one is better?
● According to the “cost” (that means the delay, throughput, reliability, money, a combination of them …)
● The nodes should decide how to route each packet routing algorithms!
● The network is alive, decisions on routing may change at any moment
u
yx
wv
z
2
2
13
1
1
2
5
3
5Graph: G = (N,E)N = set of routers = { u, v, w, x, y, z }E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Routing: Graph abstraction
Remark: Graph abstraction is also useful in other network contextsExample: P2P, where N is set of peers and E is set of TCP connections
Link cost c(x,x’) = cost of link (x,x’) e.g., c(w,z) = 5 cost could always be 1, or inversely related to bandwidth, or inversely related to congestion
Cost of path (x1, x2, x3,…, xp) =
= c(x1,x2) + c(x2,x3) + … + c(xp1,xp)
Routing algorithm: algorithm that finds least-cost path
Question: What’s the least-cost path between u and z ?
Internet Protocol Stack
application: supporting network applicationsFTP, SMTP, HTTP
transport: processprocess data transferTCP, UDP
network: routing of datagrams from source to destination IP, routing protocols
link: data transfer between neighboring network elements Ethernet, WLANs
physical: bits “on the wire/wireless”
Transport protocols
● provide logical communication between application processes running on different hosts.● transport protocols run in end systems ● send side:
– breaks app messages into segments, passes to network layer
● rcv side:
– reassembles segments into messages, passes to app layer
Two transport protocol available to apps: TCP and UDP
Logical endtoend transport
“logical”: it is independent ofthe “physical” path or theLowlayer protocols followed by packets.
Internet Transport services
1) reliable, inorder delivery (TCP)congestion control flow control connection setup
2) unreliable, unordered delivery: UDP
nofrills extension of “besteffort” IP
Transport services not available:
● delay guarantees
● bandwidth guarantees
Transport vs. Network layer
● network layer: data communication between hosts (endtoend) ● transport layer: data communication between processes (endtoend)
Host 1
IP address
Proc. 1 Proc. M
port/socket
Host 2
IP address
Proc. 1 Proc. M
? ?
Multiplexing
port/socket
Application / Process
● Application: group or processes (at least 1 process)
● Process: part of an application which handles with some specific functions.
● Example:● Application: Remote Weather Monitoring
● Two process:
– measure the weather (e.g. temperature)
– send the information to the its destination through a network.
● Some times: 1 application = 1 process
Mux / Demux
Mux: gathering data from multiple sockets, enveloping data with header (later used for demultiplexing)
Demux: delivering received segments to correct socket
62
Connection / Connectionless
● Connection oriented: there are stateinformation about transfer status in both emitter and receiver.
● The TCP protocol.
● Required for congestion control, flow control, retransmissions, etc.
● Connectionless oriented: the opposite case
● The UDP protocol.
63
Principles of Congestion Control
● Congestion: informally: “too many sources sending too much data too fast for network to handle”
● manifestations:– lost packets (buffer overflow at routers)– long delays (queueing in router buffers)
64
Causes/costs of congestion: scenario 1 ● two senders, two receivers● one router, infinite buffers ● no retransmission
● large delays when congested● maximum achievable throughput
unlimited shared output link buffers
Host Aλ in : original data
Host B
λ out
For connection
65
Causes/costs of congestion: scenario 2 ● two senders, two receivers● one router, finite buffers ● sender retransmits lost packet > more traffic to the network
finite shared output link buffers
Host A λ in : original data
Host B
λ out
λ 'in : original data, plus retransmitted data
66
Fairness goal: if K TCP sessions share same bottleneck link of bandwidth C, each should have average rate of C/K
TCP connection 1
bottleneckrouter
capacity R
TCP connection 2
Fairness (only TCPbased service)
67
Transportlayer endtoend functionalities
Endtoend error detection
Endtoend retransmissions
Flow control
Congestion control
Fairness
Internet transport protocols services
TCP service:connectionoriented: setup required between client and server processes
reliable transport between sending and receiving process
flow control: sender won’t overwhelm receiver
congestion control: throttle sender when network overloaded
does not provide: timing, minimum throughput guarantees, security
UDP service:unreliable data transfer between sending and receiving process
does not provide: connection setup, reliability, flow control, congestion control, timing, throughput guarantee, or security
Internet Protocol Stack
application: supporting network applicationsFTP, SMTP, HTTP
transport: processprocess data transferTCP, UDP
network: routing of datagrams from source to destination IP, routing protocols
link: data transfer between neighboring network elements Ethernet, WLANs
physical: bits “on the wire/wireless”
71
Aplicacions Internetapplicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
write programs that● run on (different) end
systems● communicate over network● e.g., web server software
communicates with browser software
No need to write software for networkcore devices
● Networkcore devices do not run user applications
● applications on end systems allows for rapid app development, propagation
Clientserver Architecture
server: ● alwayson host● permanent IP address● server farms for scaling
clients:● communicate with server● may be intermittently
connected● may have dynamic IP
addresses● do not communicate directly
with each other
P2P Architecture
● no alwayson server● arbitrary end systems
directly communicate● peers are intermittently
connected and change IP addresses
Highly scalable but difficult to manage
Example: requesting a web page
● Warriors of the Net:http://www.youtube.com/watch?v=Ve7_4otDzs