JA R I N G A N KO M P U T E R
Institut Teknologi Sumatera
PRESENSI RB
OUTLINE MATERI
PROTOKOL TCP/IP
LAYER 1 PHYSICAL
LAYER 2 TRANSPORT
LAYER 3 INTERNET
LAYER 4 APLLICATION
TCP/IP
Standard yang dipakai Internet hingga kini adalah standard TCP/IP.
4. Application
1. Physical
SUSUNAN PROTOKOL TCP/IP DAN MODEL OSI
APLICATION LAYER
4. Application
Lapisan aplikasi : tempat dilakukannya proses
kerja yang sesungguhnya.
Application Layer dalam TCP/IP adalah
3. Transport kombinasi lapisan-lapisan session, presentation
dan application pada OSI.
2. Internet
1. Physical
APLICATION LAYER
Pada lapisan ini TCP/IP tidak mendefinisikan
4. Application
protokol yang spesifik. Artinya TCP/IP mendukung
semua standar dan proprietary protokol lain.
3. Transport Menangani protokol-protokol high-level, isu-isu
representasi, encoding, dan kontrol session.
Menyediakan layanan (services) bagi software
2. Internet yang berjalan pada komputer.
Sebagai interface antara software yang berjalan
pada komputer dengan network.
1. Physical
Misal : http, ftp, smtp, telnet, dan lain-lain.
APLICATION LAYER
Telnet
4. Application Program yang memungkinkan akses terminal
secara remote lewat suatu jaringan(Port 23)
Service yang tersedia melalui jaringan Telnet :
3. Transport Archie, Gopher, Wais
SMTP (Send Mail Transfer Protocol)
Suatu protokol aplikasi yang merupakan sistem
2. Internet pengiriman message atau pesan atau e-mail.(Port
25)
POP (Post Office Protocol ver 3)
1. Physical Protokol untuk mengambil/menerima pesan(Port
110)
APLICATION LAYER
FTP (File Transfer Protocol)
4. Application
Protokol sekaligus program yang dapat digunakan untuk
melakukan operasi file dasar pada host remote dan untuk
mentransfer file antar host (Port 20 Transfer Data, 21 Kontrol
3. Transport Data)
Model Protokol FTP
Control Connection, yang digunakan pada pola hubungan antara
2. Internet client – server yang normal . Server membuka diri secara pasif di
sebuah port khusus (well-known port) yaitu port 21.
Data Connection, yang dibangun setiap kali sebuah file ditransfer
antara client – server. Hubungan ini bersifat “memaksimalkan ukuran
1. Physical data yang ditransfer (throughput), karena hubungan ini untuk
transfer file (Port 20)
APLICATION LAYER
4. Application TFTP (Trivial Transfer Protocol)
Protokol kecil dan efisien yang dapat
3. Transport dipasang secara mudah pada boot ROM
komputer. Workstation UNIX SUN ,
menggunakan TFTP untuk men-download
2. Internet
software operating system utama saat
melakukan boot system pada jaringan.
1. Physical
APLICATION LAYER
4. Application DNS (Domain Name System)
Pada tahun 1984, jumlah komputer yang terhubung ke internet
telah mencapai 1000 unit . Jumlah host yang harus ditulis di
3. Transport HOST.TXT menjadi terlalu banyak dan cara inipun tidak efisien.
Paul Mockaetris mengusulkan system database yang
terdistribusi yang dinamakan DNS yang mana hingga saat ini
2. Internet tetap digunakan.
Fungsi DNS :Untuk memetakan IP Address dan Nama Host,
DNS juga digunakan sebagai sarana bantu penyampaian e-
mail.
1. Physical
APLICATION LAYER
4. Application SNMP (Simple Network Management Protocol)
Secara sederhana SNMP merupakan sebuah
protokol yang didesain untuk memberikan
3. Transport kemampuan kepada pemakai untuk mengelola
jaringan komputernya dari jarak jauh atau
remote.
2. Internet
Pengeloaan ini dilaksanakan dengan cara
melakukan polling dan setting variabel-variabel
elemen jaringan yang dikelolanya.
1. Physical
TRANSPORT LAYER
4. Application
Menyediakan services transport dari host
pengirim ke penerima.
Melakukan segmentasi data dari layer
3. Transport application pada sisi pengirim kemudian
menyusunnya kembali pada sisi penerima.
2. Internet
Menangani isu-isu reliability dan flow control.
Terdiri dari 2 protokol utama
Transmission Control Protocol (TCP)
1. Physical User Datagram Protocol (UDP)
TRANSPORT LAYER
Transport layer protocol adalah protokol end-to-end
Hanya diimplementasikan pada host
Internet Internet
Network Network
Access 14 Access
TRANSPORT PROTOCOLS
Internet
Layer
Network
Access
TRANSPORT PROTOCOL
TRANSMISSION CONTROL PROTOCOL (TCP)
Connection-oriented transport protocol
menyediakan transport dari source port ke destination port
Beroperasi diatas IP
Stream-oriented (sebagai lawan dari message-oriented)
Deretan byte data diterima dari sending application bersama-sama dengan
informasi untuk header
TCP men-segmentasi deretan data dan menambahkan header
secara umum TCP menentukan kapan untuk mengakhiri segmen dan transmit
user dapat memaksa segmentasi dan transport via push function
Process sebaliknya terjadi pada TCP process di penerima
TCP
TCP bertanggung jawab untuk pemulihan data
Dengan mengunakan nomor urut pada setiap paket yang dikirimkan
TCP membutuhkan ACK (acknowledgement) untuk memastikan bahwa
data yang benar yang diterima
Paket dapat dikirim kembali jika terdeteksi kesalahan
TCP merupakan protocol yang connection-oriented, menggunakan
proses yang disebut dengan three-way handshake
Konsep TCP
22
SOME TAKE-AWAYS FROM THE EXAMPLE
Sequence numbers
Used to detect missing data
... and for putting the data back in order
Retransmission
Sender retransmits lost or corrupted data
Timeout based on estimates of round-trip time
Fast retransmit algorithm for rapid retransmission
25
TCP SEGMENTS
26
TCP “STREAM OF BYTES” SERVICE
Host A
Host B
27
…EMULATED USING TCP “SEGMENTS”
Host A
TCP Data
Host B
28
TCP SEGMENT IP Data
TCP Data (segment) TCP Hdr IP Hdr
IP packet
No bigger than Maximum Transmission Unit (MTU)
E.g., up to 1500 bytes on an Ethernet
TCP packet
IP packet with a TCP header and data inside
TCP header is typically 20 bytes long
TCP segment
No more than Maximum Segment Size (MSS) bytes
E.g., up to 1460 consecutive bytes from the stream
29
SEQUENCE
Host A NUMBERS
ISN (initial sequence number)
Sequence TCP
TCP Data
number = 1st HDR
30
INITIAL SEQUENCE NUMBER (ISN)
Sequence number for the very first byte
E.g., Why not a de facto ISN of 0?
Practical issue
IP addresses and port #s uniquely identify a connection
Eventually, though, these port #s do get used again
… and there is a chance an old packet is still in flight
… and might be associated with the new connection
31
TCP THREE-WAY HANDSHAKE
32
ESTABLISHING A TCP CONNECTION
A B
Sequence number
Flags: SYN
Acknowledgment
FIN
RST HdrLen 0 Flags Advertised window
PSH
URG Checksum Urgent pointer
ACK
Options (variable)
Data
34
STEP 1: A’S INITIAL SYN PACKET
A’s port B’s port
35
STEP 2: B’S SYN-ACK PACKET
B’s port A’s port
36
… upon receiving this packet, A can start sending data
STEP 3: A’S ACK OF THE SYN-ACK
A’s port B’s port
Sequence number
Flags: SYN
B’s ISN plus 1
FIN
RST 20 0 Flags Advertised window
PSH
URG Checksum Urgent pointer
ACK
Options (variable)
37
… upon receiving this packet, B can start sending data
WHAT IF THE SYN PACKET GETS LOST?
Suppose the SYN packet gets lost
Packet is lost inside the network, or
Server rejects the packet (e.g., listen queue is full)
Eventually, no SYN-ACK arrives
Sender sets a timer and wait for the SYN-ACK
… and retransmits the SYN-ACK if needed
How should the TCP sender set the timer?
Sender has no idea how far away the receiver is
Hard to guess a reasonable length of time to wait
Some TCPs use a default of 3 or 6 seconds
38
SYN LOSS AND WEB DOWNLOADS
User clicks on a hypertext link
Browser creates a socket and does a “connect”
The “connect” triggers the OS to transmit a SYN
If the SYN is lost…
The 3-6 seconds of delay may be very long
The user may get impatient
… and click the hyperlink again, or click “reload”
User triggers an “abort” of the “connect”
Browser creates a new socket and does a “connect”
Essentially, forces a faster send of a new SYN packet!
Sometimes very effective, and the page comes fast
39
TCP RETRANSMISSIONS
40
AUTOMATIC REPEAT REQUEST (ARQ)
• Automatic Repeat Request
–Receiver sends
acknowledgment (ACK) Sender Receiver
when it receives packet
–Sender waits for ACK and
Timeout
timeouts if it does not arrive
within some time period
Timeout
Timeout
Timeout
Timeout
Timeout
Packet lost ACK lost Early timeout
DUPLICATE DUPLICATE
PACKET PACKETS
42
HOW LONG SHOULD SENDER WAIT?
Sender sets a timeout to wait for an ACK
Too short: wasted retransmissions
Too long: excessive delays when packet lost
TCP sets timeout as a function of the RTT
Expect ACK to arrive after an RTT
… plus a fudge factor to account for queuing
But, how does the sender know the RTT?
Can estimate the RTT by watching the ACKs
Smooth estimate: keep a running average of the RTT
EstimatedRTT = a * EstimatedRTT + (1 –a ) * SampleRTT
Compute timeout: TimeOut = 2 * EstimatedRTT
43
EXAMPLE RTT ESTIMATION
RTT: gaia.cs.umass.edu to fantasia.eurecom.fr
350
300
250
RTT (milliseconds)
200
150
100
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106
time (seconnds)
44
SampleRTT Estimated RTT
A FLAW IN THIS APPROACH
An ACK doesn’t really acknowledge a transmission
Rather, it acknowledges receipt of the data
Consider a retransmission of a lost packet
If you assume the ACK goes with the 1st transmission
… the SampleRTT comes out way too large
Consider a duplicate packet
If you assume the ACK goes with the 2nd transmission
… the Sample RTT comes out way too small
Simple solution in the Karn/Partridge algorithm
Only collect samples for segments sent one single time
45
User Datagram Protocol (UDP)
TCP/IP 59
CSMA/CD
Carrier Sense Multiple Access with Collision Detection
Carrier Sense : can tell when another host is transmitting
Multiple Access : many hosts on 1 wire
Collision Detection : can tell when another host transmits at the same
time.
TCP/IP 60
AN ETHERNET FRAME
Destination Source
Preamble Len DATA CRC
Address Address
8 bytes 6 6 2 0-1500 4
Each interface looks at every frame and inspects the destination address. If the
address does not match the hardware address of the interface (or the broadcast
address), the frame is discarded.
TCP/IP 62
INTERNET PROTOCOL
IP is the network layer
packet delivery service (host-to-host).
translation between different data-link protocols
TCP/IP 63
IP ADDRESSES
IP addresses are not the same as the underlying data-link (MAC)
addresses.
Why ?
IP is a network layer - it must be capable of providing
communication between hosts on different kinds of networks
(different data-link implementations).
TCP/IP 65
THE FOUR FORMATS OF IP ADDRESSES
Class
A 0 NetID HostID
128 possible network IDs, over 4 million host IDs per network
ID
B 10 NetID HostID
16K possible network IDs, 64K host IDs per network ID
TCP/IP 67
IP ADDRESSES
IP Addresses are usually shown in dotted decimal notation:
1.2.3.4
00000001 00000010 00000011 00000100
cse.unr.edu is 134.197.40.3
10000110 11000101 00101000 00000010
TCP/IP 69
SUBNET ADDRESSES
An organization can subdivide it’s host address space into groups called
subnets.
The subnet ID is generally used to group hosts based on the physical
network topology.
TCP/IP 70
SUBNETTING router
TCP/IP 71
SUBNETTING
Subnets can simplify routing.
IP subnet broadcasts have a hostID of all 1s.
It is possible to have a single wire network with multiple subnets.
TCP/IP 72
MAPPING IP ADDRESSES TO HARDWARE ADDRESSES
IP Addresses are not recognized by hardware.
If we know the IP address of a host, how do we find out the hardware address ?
The process of finding the hardware address of a host given the IP address is called
Address Resolution
TCP/IP 73
IP HEADER
1 byte 1 byte 1 byte 1 byte
VERS HL Service Fragment Length
Datagram ID FLAG Fragment Offset
TTL Protocol Header Checksum
Source Address
Destination Address
Options (if any)
Data
TCP/IP 74
Versi-Versi TCP/IP
◦ TCP/IP menjadi protokol secara resmi untuk aplikasi
internet adalah tahun 1983. Sejak itu hingga
sekarang telah digunakan secara luas hingga versi 4
atau disebut IPv4.
◦ Pernah versi 5 diajukan sebagai proyek namun
akhirnya gagal karena berbagai sebab. Namun
pada saat ini pula sudah mulai disosialisasikan IP
versi next generation, banyak kalangan
menyebutnya IPv6.
◦ Di mana pada IPv4 alamat IP menggunakan 32 bit
(4 byte) tapi IPv6 menggunakan 128 bit (16 byte).
Pada IPv6 sudah dilengkapi dengan dukungan
authentication, data integrity dan confidentiality.
TERIMA KASIH