Вы находитесь на странице: 1из 9

Understanding the Stack

Recall the TCP/IP Internet Architecture

End-to-End Protocols
(Week 12) FTP HTTP NV RTP
80 4444
20,21

TCP UDP
6 17

IP
Jaringan Komputer
NET1 NET2 … NETn

Fakultas Ilmu Komputer


Universitas Indonesia
Semester Genap 2003/2004
Versi: 1 2 Versi 1

Basic Transport-layer Function End-to-end Communication


Network layer: end-to-end logical
communication between hosts
Transport layer (rely on network layer): logical
communication between application-level comm.
end-points
Multiple application-level end-points can reside in one host
Application-level end-points can be a Web browser/server,
a FTP client/server, etc
Transport layer: end-to-end implementation

3 Versi 1 4 Versi 1

1
Transport-layer Service Model Internet Transport-layer Protocols
Transport layer: logical communication between UDP: connectionless
application end-point point. multiplexing/demultiplexing
multiplexing/demultiplexing error detection
Additional services: TCP: connection oriented
reliable data transfer (guaranteed arrival, no error, in-
order) multiplexing/demultiplexing
flow control (keep sender from overrunning receiver): reliable data transfer
good for myself flow control
congestion control (keep sender from overrunning congestion control
network): good for everybody
services not available:
delay guarantees
bandwidth guarantees

5 Versi 1 6 Versi 1

How multiplexing/demultiplexing works? Port Numbers


Each port number is a 16-bit number, ranging from 0
to 65535.
Port numbers ranging from 0 to 1023 are called well-
using port numbers known port numbers and are restricted.
each IP datagram has source IP address, destination IP Port number vs. socket
address
each IP datagram carries a transport-layer segment socket (true destination attached to app. end-point)
each segment has source, destination port number port number (a mechanism to identify socket)
port number??
dest. IP address for routing to the host; IP addresses and
Analogy PABX system vs Internet:
port numbers for going to appropriate socket in the dest. Phone no ≈ Internet address
host. Extension no ≈ Port no

7 Versi 1 8 Versi 1

2
Simple Demultiplexor (UDP) UDP: User Datagram Protocol
Unreliable and unordered datagram service What is a connection?
Adds multiplexing a group of segments between the same pair of comm. endpoints
0 16 31
No flow control SrcPort DstPort
allow for shared resources, provide services more efficiently

Endpoints identified by ports Checksum Length UDP is connectionless:


each UDP segment handled independently of others
servers have well-known ports Data

see /etc/services on Unix UDP does


Header format multiplexing/demultiplexing
simple error detection
Optional checksum
pseudo header + UDP header + data UDP does not do
Pseudo header consists of: reliable data transfer, flow control, congestion control …
Protocol no (6 for TCP, 17 for UDP)
Source IP
Destination IP
Length field

9 Versi 1 10 Versi 1

What is good about UDP? UDP: more


TCP features may not be needed by some Often used for streaming
applications, such as? multimedia apps
loss tolerant
Less overhead:
rate sensitive
no connection establishment (which can add delay)
small segment header In general, UDP is also
used when TCP features
no congestion control: UDP can blast away as fast as
desired are not important
What if you want a subset
Simple: no connection state at sender, receiver
of features in TCP?
implemented at application-
level
flow control and error
recovery in many
multimedia apps

11 Versi 1 12 Versi 1

3
End-to-End Protocols TCP Overview
Underlying best-effort network (IP service):
Connection-oriented Full duplex
drop messages
Byte-stream Flow control: keep sender from
re-orders messages
app writes Bytes overrunning receiver
delivers duplicate copies of a given message
TCP sends segments Congestion control: keep
limits messages to some finite size app reads Bytes sender from overrunning
delivers messages after an arbitrarily long delay network
Common end-to-end services:
guarantee message delivery
Application process Application process
deliver messages in the same order they are sent
deliver at most one copy of each message Write Read
Bytes Bytes


support arbitrarily large messages
TCP TCP
support synchronization Send buffer Receive buffer
allow the receiver to flow control the sender
support multiple application processes on each host Segment Segment

Segment
Transmit segments

13 Versi 1 14 Versi 1

Reliable Data Transfer Simple Reliability: send/ACK


Sender Receiver Sender Receiver

Our goal: end-to-end solution to achieve reliable Fram


e
Fram
e

data transfer

Timeout

Timeout
Time
ACK ACK
What is reliable data transfer?
Fram
guaranteed arrival e

Timeout
no error ACK

in order delivery
(a) (c) duplication
Why is it difficult?
end-to-end solution has no control of underlying Sender Receiver Sender Receiver
communication channel, which can be error-prone Fram Fram
and lossy e e

Timeout
Timeout
Where is it used in computer networks? ACK
Fram
reliable data link service on top of unreliable physical e

Timeout
Fram
e
layer
Timeout

ACK

reliable transport service on top of unreliable IP ACK

(b) (d)
duplication
15 Versi 1 16 Versi 1

4
Stop-and-Wait Bandwidth & Latency (Review)
Problem: Overhead ACK: min. 1 RTT, sender Kinerja jaringan diukur dalam dua kategori:
stop Bandwidth (throughput): jumlah bits yang dapat di-
Example transfer dalam satu periode waktu
• Misalkan: 1 Mbits/detik => 1 Mbps, berarti dapat mengirimkan data
Mak. bit yang dapat dikirimkan: BW x latency. 1 juta bit setiap detik;
BW = Bandwidth • Bandwidth 1 Mbps, diperlukan waktu 1 mikro-detik untuk
1.5Mbps link x 45ms latency = 67.5Kb ≈ 8KB mengirimkan 1 bit.
1KB Byte setiap 90ms => 1/16 utilisasi BW (link) Latency (delay): berapa lama waktu yang diperlukan
Sender Receiver untuk mengirimkan “message” dari satu ujung (end) ke
Length = latency ujung lainnya.
bandwidth
• Ukuran latency adalah satuan waktu.
• Misalkan: latency untuk jaringan JKT – SBY: 20 milidetik (one-
Capacity = bandwidth X latency way).
• Pengukuran lain Round-Trip Time (RTT): latency message bolak
balik (two way).

17 Versi 1 18 Versi 1

Example: Latency Network (Review) Example: Latency Network (Review)


Kemungkinan output link sedang digunakan, maka paket harus antri
A B (queued) di dalam buffer => delay antrian
R2
Source R1 R3 Destination
R4 Host A TRANSP1

TRANSP1 Q2
Host A R1
TRANSP2

“Store-and-Forward” at each Router PROP1


TRANSP3
TRANSP2
R1 R2
PROP2
PROP1 TRANSP4
R2
TRANSP3 R3
PROP3
PROP2
R3
TRANSP4
Host B
PROP3
Host B
PROP4

PROP4
Actual end to end latency = ∑ (TRANSPi + PROPi + Qi )
Minimum end to end latency = ∑ (TRANSPi + PROPi )
i

19 Versi 1 20 Versi 1

5
E.g. : Exercise 1.5 (Page 61) - Review E.g. : Exercise 1.5 (Page 61) - Review
Hitung waktu transfer 1000 KB file, asumsi *RTT=100ms, Hitung waktu transfer 1000 KB file, asumsi *RTT=100ms,
ukuran paket 1KB data, dan diperlukan 2 RTT untuk ukuran paket 1KB data, dan diperlukan 2 RTT untuk
handshaking awal. handshaking awal.
a) Badwidth 1.5 Mbps, dan paket data dikirim secara kontinyu b) Badwidth 1.5 Mbps, dan paket data tidak dikirim secara
(tidak terputus) kontinyu, tapi setiap satu paket dikirimkan sender harus
- Gunakan rumus latency dan perhitungkan semua faktor yang menunggu 1 RTT, kemudian mengirim paket berikutnya.
memberikan kontribusi terjadinya delay dari sender ke receiver. - Dengan cara ini terdapat overhead 1 RTT pada paket kedua, ketiga,
- Latency = [handshaking] + waktu propagasi [paket 1, one way] + dst sampai paket ke-1000; paket pertama tidak perlu menunggu
waktu transmisi sehingga total delay dari 1000 paket tsb adalah 999 RTT.
- Latency = [2 * RTT] + [RTT/2] + [BesarData/Bandwidth] - Latency = [handshaking] + waktu propagasi [paket 1, one way] +
- Latency = [200ms] + [50 ms] + [1000KB/1.5Mbps] waktu transmisi + [total delay overhead menunggu]
- Latency = [200ms] + [50 ms] + [(1000*1024*8)/(1.5 * 106) s] - Latency = 5.71 s + [999 * RTT]
- Latency = 0.25 s + 5.46 s = 5.71 second - Latency = 105.61 second.

- *Catatan: Di sini RTT = propagation delay - *Catatan: Di sini RTT = propagation delay

21 Versi 1 22 Versi 1

Sliding Window Segment Format


Allow multiple outstanding (un-ACKed) Bytes
Upper bound on un-ACKed Bytes, called window 10
0 4 16 31
SrcPort DstPort
Sender Receiver
SequenceNum

Acknowledgment

HdrLen 0 Flags AdvertisedWindow



Time

Checksum UrgPtr

Options (variable)

Data

23 Versi 1 24 Versi 1

6
Segment Format (cont) Connection Establishment and Termination

Each connection identified with 4-tuple:


(SrcPort, SrcIPAddr, DsrPort, DstIPAddr) Three way handshake

Sliding window + flow control Active participant Passive participant


acknowledgment, SequenceNum, AdvertisedWinow (client) (server)
SYN,
Seq uence
Data(SequenceNum) Num
= x
Sender Receiver = y,
Num
ence
, Se qu = x+1
Acknowledgment + Y N + AC
K
ledgment
S o w
AdvertisedWindow Ackn
Flags ACK,
Ackno
wledg
SYN, FIN, RESET, PUSH, URG, ACK me nt = y
+1
Checksum
pseudo header + TCP header + data

25 Versi 1 26 Versi 1

Flow Control – Credit Allocation


[STAL00] Stalling W., Data and Computer Communications 6th ed, Prentice-Hall:2000, § 17.1 Sending and Receiving Perspectives
1 segment = 200 octets
Initial W = 7 segments (1400 octets)

27 Versi 1 28 Versi 1

7
TCP Congestion Control Receiver vs Network Capacity

Yang lebih berperan mengendalikan


kemacetan adl lapisan transport (transport
layer).
Kemacetan dpt dikendalikan jika data rate
dikurangi, dan hal tsb merupakan porsi tugas
lapisan transport.
[TAN03] Tanenbaum, A.S., Computer
Networks 4th ed. Prentice-Hall: 2003,
§ 6.5.9.

(a) A fast network feeding a low-capacity receiver (b) A slow network feeding a high capacity network

29 Versi 1 30 Versi 1

Masalah & Penyelesaiannya Effective Window Size

Masalah: Ukuran jendela yg aman menurut ES asal.


Apakah TCP congestion control cukup jika hanya Min(receiver window size, congestion
mengandalkan ukuran jendela (window size) yg window size).
ditentukan oleh End System (ES) tujuan? Lihat Jika ES tujuan menyanggupi ukuran
slide 31. jendela 8KB, tetapi ES asal mengetahui
Bagaimana dgn internal congestion pd slide kapasitas jaringan hanya 4KB -> ES asal
memilih jendela berukuran 4KB.
sebelum ini?
Jika ES tujuan menyanggupi ukuran
Penyelesaiannya: jendela 8KB, dan ES asal mengetahui
Selain receiver window, perlu juga congestion kapasitas jaringan 32 KB -> ES asal
window. memilih jendela berukuran 8KB.

31 Versi 1 32 Versi 1

8
Slow Start & Threshold Algoritma Slow Start & Threshold

Mekanisme yg dilakukan ES asal utk 1. Congestion window diberi nilai 1 segmen.


memperkirakan kapasitas jaringan. 2. Dilakukan slow start sampai congestion
window mencapai threshold (pertambahan
Slow start (Jacobson 1988): secara ekponesial).
Congestion window bertambah besar secara 3. Kemudian congestion window bertambah
eksponensial, sampai terjadi timeout atau secara linier, hingga mencapai receiver window
receiver window tercapai. atau terjadi timeout.
4. Jika terjadi timeout, threshold diperkecil
Penambahan congestion window terjadi jika ES menjadi ½ dr congestion window terakhir.
asal menerima ACK dr segmen yg telah Kembali ke langkah 1.
dikirimkan sebelum timeout.
Bagaimana jika congestion window mencapai
receiver window?
33 Versi 1 34 Versi 1

Slow Start & Threshold E.g. Slow Start & Threshold

Dalam suatu koneksi TCP, ES tujuan dpt


mengubah ukuran receiver window. Lihat
slide 31.
ICMP Source quench akan dilaporkan ke
TCP & dianggap sbg timeout.
Timer management sangat penting &
ditentukan secara statistik.

35 Versi 1 36 Versi 1

Вам также может понравиться