tcp
Post on 29-Jun-2015
104 Views
Preview:
DESCRIPTION
TRANSCRIPT
TCP/IPTCP/IP
TCP/IPTCP/IP TCP/IP หรื�อ Transmission Control Protocol/ Internet
Protocol ได้�มีการืใช้�งานก�นอย่�างแพรื�หลาย่ เป็�นโป็รืโตคอลช้น�ด้ที่�ให�ใช้�ฟรืไมี�ต�องจ่�าย่ค�า
ล�ขสิ�ที่ธิ์�%
TCP/IPTCP/IPเป็�นโป็รืโตคอลหล�กในอ�นเตอรื&เน'ต ที่(าให�
มีาตรืฐานของ TCP/IP เป็�นที่�ย่อมีรื�บก�นอย่�างกว้�างขว้าง และมีผู้.�ใช้�รื�บสิ�งข�อมี.ลมีากที่�สิ/ด้ใน
ป็0จ่จ่/บ�น
TCP/IPTCP/IP TCP/IP ถู.กสิรื�างข23นโด้ย่การือ�างอ�งจ่าก มีาตรืฐานของ OSI Model (Open System Interconnection) TCP/IP มีการืแบ�งโป็รืโตคอลสิ��อสิารืออกเป็�น 4 ช้�3น ที่(าให�สิามีารืถูเป็รืย่บเที่ย่บก�บ OSI Model ได้�ง�าย่ เรืย่กล(าด้�บช้�3นของ TCP/IP ว้�า “ TCP/IP Stack ” แต�ละช้�3นมีช้��อเรืย่กที่�แตกต�างก�น
โครืงสิรื�างของโป็รืโตคอล TCP/IPProcess Layer
(FTP, Telnet, SNMP)
Host – to - Host Layer(TCP)
Internet Layer(IP)
Network Interface(IEEE 802.3, 802.5)
ช้�3นบน เรืย่กว้�า Process Layer เป็�น
Application Protocol ที่(าหน�าที่�
เช้��อมีต�อก�บผู้.�ใช้� และให�บรื�การืต�าง ๆ เช้�น FTP, Telnet, SNMP ฯลฯ
โครืงสิรื�างของโป็รืโตคอล TCP/IP
Process Layer(FTP, Telnet, SNMP)
Host – to - Host Layer(TCP)
Internet Layer(IP)
Network Interface(IEEE 802.3, 802.5)
ช้�3นถู�ด้มีา เรืย่กว้�า Host-to-Host Layer จ่ะเป็�น TCP
หรื�อ UDP ที่(าหน�าที่�คล�าย่ก�บ Layer ที่� 4
ของ OSI Model ค�อ คว้บค/มีการืรื�บ-สิ�งข�อมี.ลจ่ากป็ลาย่ด้�านสิ�งถู2งป็ลาย่ด้�านรื�บข�อมี.ล และต�ด้ข�อมี.ลออกเป็�นสิ�ว้นย่�อย่ให�เหมีาะก�บเครื�อข�าย่ที่�ใช้�รื�บสิ�ง
ข�อมี.ลรืว้มีที่�3งป็รืะกอบข�อมี.ลสิ�ว้นย่�อย่ ๆ น3เข�าด้�ว้ย่ก�นเมี��อถู2งป็ลาย่ที่าง
โครืงสิรื�างของโป็รืโตคอล TCP/IP
Process Layer(FTP, Telnet, SNMP)
Host – to - Host Layer(TCP)
Internet Layer(IP)
Network Interface(IEEE 802.3, 802.5)
ช้�3นถู�ด้ลงมีา เรืย่กว้�า Internet Layer ได้�แก� สิ�ว้น
ของโป็รืโตคอล IP ที่(าหน�าที่�คล�าย่ก�บ Layer ที่� 3 ของ OSI
Model ค�อ เช้��อมีต�อคอมีพ�ว้เตอรื&เข�าก�บรืะบบเครื�อข�าย่ที่�อย่.�ช้�3นล�าง
ลงไป็ และที่(าหน�าที่�เล�อกเสิ�นที่างการืรื�บสิ�งข�อมี.ลผู้�านอ/ป็กรืณ์&
เครื�อข�าย่ต�าง ๆ จ่นไป็ถู2งผู้.�รื�บข�อมี.ล ในช้�3นน3จ่ะจ่�ด้การืก�บกล/�มี
ข�อมี.ลในล�กษณ์ะที่�เรืย่กว้�า Frame ในรื.ป็แบบของ TCP/IP
ที่�เรืารื.�จ่�กก�นน��นเอง
โครืงสิรื�างของโป็รืโตคอล TCP/IP
Process Layer(FTP, Telnet, SNMP)
Host – to - Host Layer(TCP)
Internet Layer(IP)
Network Interface(IEEE 802.3, 802.5)
ช้�3นสิ/ด้ที่�าย่ที่�อย่.�ล�างสิ/ด้ เรืย่กว้�า Network Interface ค�อ ช้�3นที่�คว้บค/มีฮารื&ด้แว้รื&การืรื�บสิ�งข�อมี.ล
ผู้�านเครื�อข�าย่ ซึ่2�งเที่ย่บได้�ก�บ Layer ที่� 1 และ 2 ของ OSI Model ในช้�3นน3จ่ะที่(าหน�าที่�เช้��อมีต�อก�บฮารื&ด้แว้รื& และคว้บค/มีการืรื�บสิ�งข�อมี.ลในรืะด้�บ
ฮารื&ด้แว้รื&ของเครื�อข�าย่ ซึ่2�งที่�ใช้�ก�นอย่.�จ่ะเป็�นตามีมีาตรืฐานของ IEEE เช้�น IEEE 802.3 จ่ะเป็�นการืเช้��อมีต�อ
ผู้�าน LAN แบบ Ethernet LAN หรื�อ IEEE 802.5 จ่ะเป็�นการืเช้��อมีต�อผู้�าน LAN แบบ Token Ring
โครืงสิรื�างของโป็รืโตคอล TCP/IP
Process Layer(FTP, Telnet, SNMP)
Host – to - Host Layer(TCP)
Internetwork Layer(IP)
Network Interface(IEEE 802.3, 802.5)
TCP/IP โป็รืโตคอล เที่ย่บก�บ OSI 7-Layer Reference ModelTCP/IP Stack
OSI 7-Layer ModelProcess Layer
(FTP, Telnet, SNMP)
Host – to - Host Layer(TCP)
InternetLayer(IP)
Network Interface(IEEE 802.3, 802.5)
Application Layer
Presentation Layer
Session Layer
DataLink Layer
Physical Layer
Transport Layer
Network Layer
โครืงสิรื�างของโป็รืโตคอล TCP/IP
จ่รื�ง ๆ แล�ว้ TCP/IP โป็รืโตคอลน�3นแบ�งออกเป็�น 2 โป็รืโตคอลซึ่�อนก�นอย่.� ค�อ
TCP อย่.�ช้�3นบน IP อย่.�ช้�3นถู�ด้ลงมีา
TCP/IP จ่2งไมี�ได้�เป็�นโป็รืโตคอลช้น�ด้เด้ย่ว้ก�นที่�3งหมีด้ และไมี�ได้�เช้��อมีต�ด้เป็�นช้�3น
เด้ย่ว้ก�น
โครืงสิรื�างของโป็รืโตคอล TCP/IP
TCP มีมีาตรืฐานของเฟรืมีที่�ใช้�รื�บสิ�งข�อมี.ลของมีต�ว้เอง และมีหน�าที่�ในการืรื�บสิ�งข�อมี.ลแตกต�างไป็จ่าก IP ซึ่2�งในการืรื�บสิ�ง
ข�อมี.ลน�3น เฟรืมีของ TCP ที่�อย่.�ช้�3นบนที่�3งหมีด้จ่ะถู.กผู้น2กอย่.�ในสิ�ว้นที่�เป็�นข�อมี.ลของ IP
เหมี�อนก�บที่�แต�ละช้�3นของ OSI Model ผู้น2กข�อมี.ลในช้�3นถู�ด้ไป็น��นเอง
โครืงสิรื�างของโป็รืโตคอล TCP/IP
OSI Model ออกแบบมีาให�เป็;ด้กว้�าง สิามีารืถูอ�างอ�งถู2งก�นได้�เป็�นอย่�างด้ก�บ
TCP/IP โด้ย่ TCP จ่ะเที่ย่บได้�ก�บป็รืะมีาณ์ Layer ที่� 4 ของ OSI และ IP จ่ะเที่ย่บได้�ก�บป็รืะมีาณ์ Layer ที่� 3 ของ OSI แมี�ว้�า
จ่ะไมี�ลงต�ว้ก�นพอด้น�ก
Internetworking
The Slides are based on
Computer Networks and Internet
Of Douglas E. Comer
Topics
• Internetwork• Internet Architecture• Goals• Internet Protocols• TCP Layers• Datagram Transmission• Frames and Datagrams• IP Semantics• Transport Protocol : UDP, TCP
ล�กษณ์ะของการืสิ�งผู้�านล�กษณ์ะของการืสิ�งผู้�านข�อมี.ลข�อมี.ล
The IP ProtocolThe IP Protocol
Datagram Transmission
• Datagram sent across conventional network– From source host and router– Between intermediate routers– From final router to destination host
• Network hardware does not recognize– Datagram format– IP addresses
• Encapsulation needed
IP Encapsulation
• Entire datagram treated like data• Frame type identifies contents as IP datagram• Frame destination address gives next hop
Frames and Datagrams
• Datagram survives entire trip across Internet
• Frame only survives one hop
• Frame address– Hardware (MAC) address– Next hop
• Datagram address– IP address– Ultimate destination
Frame Address For Encapsulated Datagram
• A datagram is encapsulated in a frame for
transmission across a physical network.
• The destination address in the frame is the
address of the next hop to which the datagram
should be sent; the address is obtained by
translating the IP address of the next hop to
an equivalent hardware address.
Window Advertisement
• Each acknowledgment carries new window information window advertisement– Can be zero closed window)
• Interpretation:
“ I have received up through X, and can take Y more octets. ”
Window Advertisement
Startup and Shutdown
• Connection startup– Must be reliable
• Connection shutdown– Must be graceful
• Difficult WHY ?
Why Startup/Shutdown Difficult?
• Segments can be– Lost– Duplicated– Delayed– Delivered out of order– Either side can crash– Either side can reboot
• Need to avoid duplicate “shutdown” message from affecting later connection
TCP’s Startup/Shutdown Solution
• Uses three-message exchange
• Known as 3-way handshake3-way handshake• Necessary and sufficient for
– Unambiguous, reliable startup– Unambiguous, graceful shutdown
• SYN used for startup
• FIN used for shutdown
3-Way Handshake
TCP Segment Format (1)
• All TCP segments have same format– Data– Acknowledgment– SYN (startup)– FIN (shutdown)
• Segment divided into two parts– Header– Payload area (zero or more bytes of data)
TCP Segment Format (2)• Header contains
– Protocol port numbers to identify• Sending application• Receiving application
– Bits to specify items such as• SYN• FIN• ACK
– Fields for window advertisement, acknowledgment, etc.
Illustration of TCP Segment
top related