62
Chap 9 TCP/IP Andres, Wen-Yuan Liao Andres, Wen-Yuan Liao Department of Computer Science and Department of Computer Science and Engineering Engineering De Lin Institute of Technology De Lin Institute of Technology [email protected] [email protected] http://www.cse.dlit.edu.tw/~andres http://www.cse.dlit.edu.tw/~andres

Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology [email protected] andres

Embed Size (px)

Citation preview

Page 1: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Chap 9 TCP/IPAndres, Wen-Yuan LiaoAndres, Wen-Yuan Liao

Department of Computer Science and EngineeringDepartment of Computer Science and Engineering

De Lin Institute of TechnologyDe Lin Institute of Technology

[email protected]@dlit.edu.tw

http://www.cse.dlit.edu.tw/~andreshttp://www.cse.dlit.edu.tw/~andres

Page 2: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 3: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Overview TCP/IP operation TCP/IP operation TCP/IP protocol stack TCP/IP protocol stack

componentcomponent Reliable and unreliable Reliable and unreliable

transport layer protocols transport layer protocols ICMP/ARP/RARPICMP/ARP/RARP

Page 4: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

The TCP/IP Protocol Suite  TCP/IP protocols & the OSI TCP/IP protocols & the OSI

modelmodel TThe application layerhe application layer The transport layerThe transport layer TCP and UDP segment formatTCP and UDP segment format Port numbers Port numbers Three-way handshakeThree-way handshake Acknowledgment & windowingAcknowledgment & windowing

Page 5: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

TCP/IP protocols and the OSI model Defense Advanced Defense Advanced

Research Projects Agency Research Projects Agency (DARPA) (DARPA)

TCP/IP is the de facto TCP/IP is the de facto standard for internetwork standard for internetwork communications communications

Page 6: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

TCP/IP

A universally available protocol A universally available protocol A useful reference for A useful reference for

understanding other protocols understanding other protocols BeBe important because the router important because the router

uses it as a configuration tooluses it as a configuration tool

Page 7: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 8: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 9: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

TCP/IPThe layers most closely The layers most closely

affected by TCP/IP are Layer affected by TCP/IP are Layer 7, Layer 4, and Layer 3 7, Layer 4, and Layer 3

Enable communication Enable communication among any set of among any set of interconnected networksinterconnected networks

Page 10: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Application layer

Supports addressing protocols Supports addressing protocols and network managementand network management

Has protocols for file Has protocols for file transfer, e-mail, and remote transfer, e-mail, and remote loginlogin

Page 11: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 12: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

translating names of domains and their publicly advertised network nodes into addresses

Translate names of domains into

addresses

Page 13: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

WINS

Windows Internet Naming ServiceWindows Internet Naming Service Microsoft-developed standard for Microsoft-developed standard for

Microsoft Windows NT that Microsoft Windows NT that automatically associates NT automatically associates NT workstations with Internet domain workstations with Internet domain namesnames

Page 14: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

HOSTS

A file created by network A file created by network administrators and maintained administrators and maintained on serverson servers

Be used to provide static Be used to provide static mapping between IP addresses mapping between IP addresses and computer namesand computer names

Page 15: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 16: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

SMTP

Simple Mail Transport ProtocolSimple Mail Transport Protocol Governs the transmission of e-Governs the transmission of e-

mail over computer networksmail over computer networks Does not provide support for Does not provide support for

transmission of data other than transmission of data other than plain textplain text

Page 17: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

SNMP

Simple Network Management Simple Network Management ProtocolProtocol

Provides a means to monitor and Provides a means to monitor and control network devices, and to control network devices, and to manage configurations, statistics manage configurations, statistics collection, performance and collection, performance and security security

Page 18: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

FTP File Transfer ProtocolFile Transfer Protocol A reliable connection-oriented A reliable connection-oriented

service that uses TCP to transfer service that uses TCP to transfer files between systems that files between systems that support FTPsupport FTP

Supports bi-directional binary file Supports bi-directional binary file and ASCII file transfersand ASCII file transfers

Page 19: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

TFTP

Trivial File Transfer ProtocolTrivial File Transfer Protocol A connectionless unreliable A connectionless unreliable

service service Be useful in some LANs Be useful in some LANs

because it operates faster than because it operates faster than FTP in a stable environmentFTP in a stable environment

Page 20: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

HTTP Hypertext Transfer ProtocolHypertext Transfer Protocol Supports the exchange of Supports the exchange of

information on the WWWinformation on the WWW Supports many different file Supports many different file

types, including text, graphic, types, including text, graphic, sound, and videosound, and video

Page 21: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Troubleshooting protocols 

TelnetTelnet PINGPING TracerouteTraceroute NBSTATNBSTAT NETSTATNETSTAT ipconfig/winipcfgipconfig/winipcfg

Page 22: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

NBSTAT

To troubleshoot NetBIOS To troubleshoot NetBIOS name resolutionname resolution

Be used to view and remove Be used to view and remove entries from the name cacheentries from the name cache

Page 23: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 24: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

NETSTAT

Provides information about Provides information about TCP/IP statisticsTCP/IP statistics

Be used to provide information Be used to provide information about the status of TCP/IP about the status of TCP/IP connections and summaries of connections and summaries of ICMP, TCP, and UDP ICMP, TCP, and UDP

Page 25: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 26: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

ipconfig/winipcfg

View current network View current network settings for all ip (nic) settings for all ip (nic) adapters on a deviceadapters on a device

Be used to view the MAC Be used to view the MAC address, IP address, and address, IP address, and gateway gateway

Page 27: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 28: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Transport layer

End-to-end service (segment)End-to-end service (segment) Layer 4 data streamLayer 4 data stream

A logical connection between A logical connection between the endpoints of a networkthe endpoints of a network

Provides transport services Provides transport services from a host to a destinationfrom a host to a destination

Page 29: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 30: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

TCP A connection-oriented, reliable A connection-oriented, reliable

protocolprotocolFlow control: sliding windowsFlow control: sliding windowsReliability: sequence numbers and Reliability: sequence numbers and

acknowledgmentsacknowledgmentsRe-sends/Virtual circuit Re-sends/Virtual circuit Provides guaranteed deliveryProvides guaranteed delivery

Page 31: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

UDP Connectionless and unreliableConnectionless and unreliable Responsible for transmitting Responsible for transmitting

messagesmessagesNo software checking No software checking

Advantage: speedAdvantage: speed No acknowledgments/less traffic No acknowledgments/less traffic

is sent/making the transfer fasteris sent/making the transfer faster

Page 32: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 33: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 34: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Protocols using UDP

TFTPTFTPSNMPSNMP Network File System (NFS)Network File System (NFS) Domain Name System Domain Name System

(DNS)(DNS)

Page 35: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

TCP and UDP port numbers

Use port numbers to pass Use port numbers to pass information to the upper layersinformation to the upper layers

Keep track of the different Keep track of the different conversations conversations

Well-known port numbersWell-known port numbers

Page 36: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 37: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Port numbers assignment

Numbers below 255 are for public Numbers below 255 are for public applicationsapplications

Numbers 255-1023 are assigned to Numbers 255-1023 are assigned to companies for marketable companies for marketable applicationsapplications

Numbers above 1023 are Numbers above 1023 are unregulatedunregulated

Page 38: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Originating source port numbers, usually some numbers larger than 1023, are dynamically assigned by the source host

Page 39: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Three-way handshake Connection establishmentConnection establishment

The two end stations must The two end stations must synchronize on each other's initial synchronize on each other's initial TCP sequence numbers (ISNs)TCP sequence numbers (ISNs)

Sequence numbers Sequence numbers Track the order of packets and to Track the order of packets and to

ensure that no packets are lostensure that no packets are lost

Page 40: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 41: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Simple acknowledgment and windowing To govern the flow of data To govern the flow of data

between devices, between devices, TCP uses TCP uses a peer-to-peer flow control a peer-to-peer flow control mechanismmechanism

Page 42: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Window size

The number of bytes that The number of bytes that are transmitted before are transmitted before receiving an receiving an acknowledgmentacknowledgment

Page 43: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Acknowledgments

TCP uses expectational TCP uses expectational acknowledgments, meaning acknowledgments, meaning that the acknowledgment that the acknowledgment number refers to the octet number refers to the octet expected nextexpected next

Page 44: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 45: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Sliding window

The The slidingsliding The window size is The window size is

negotiated dynamically negotiated dynamically during the TCP sessionduring the TCP session

A larger window size allows A larger window size allows more data to be transmittedmore data to be transmitted

Page 46: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 47: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 48: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Sequence and acknowledgment numbers

Each datagram is numbered Each datagram is numbered At the receiver, TCP reassembles At the receiver, TCP reassembles

the segments into a complete the segments into a complete messagemessage

If a sequence number is missing If a sequence number is missing in the series, that segment is in the series, that segment is retransmitted (timeout)retransmitted (timeout)

Page 49: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Layer 3 Concepts

TCP/IP and the Internet TCP/IP and the Internet LayerLayer

Diagram the IP datagramDiagram the IP datagram Internet Control Message Internet Control Message

Protocol (ICMP)Protocol (ICMP) How ARP worksHow ARP works

Page 50: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 51: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

TCP/IP & the Internet Layer

ICMPICMP -- provides control and -- provides control and messaging capabilitiesmessaging capabilities

ARPARP -- IP addresses -- IP addresses -> -> the data the data link layer address link layer address

RARPRARP -- data link layer addresses -- data link layer addresses -> network addresses-> network addresses

Page 52: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 53: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

IP Header VERSVERS -- version number -- version number HLENHLEN -- header length, in 32-bit words -- header length, in 32-bit words type of servicetype of service -- how the datagram -- how the datagram

should be handled should be handled total lengthtotal length -- total length (header + data) -- total length (header + data) identification, flags, frag offsetidentification, flags, frag offset -- --

provides fragmentation of datagrams to provides fragmentation of datagrams to allow differing MTUs in the internetworkallow differing MTUs in the internetwork

Page 54: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

IP Header TTLTTL -- Time-To-Live -- Time-To-Live protocol protocol -- the upper-layer (Layer 4) -- the upper-layer (Layer 4)

protocol sending the datagram protocol sending the datagram header checksumheader checksum -- an integrity check -- an integrity check

on the headeron the header source source and and destination IP addressdestination IP address IP optionsIP options -- network testing, -- network testing,

debugging, security, and other optionsdebugging, security, and other options

Page 55: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 56: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Internet Control Message Protocol (ICMP) ICMP messages are carried ICMP messages are carried

in IP datagrams and are in IP datagrams and are used to send error and used to send error and control messagescontrol messages

Page 57: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 58: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 59: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 60: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

How ARP works

ARP is used to resolve or map ARP is used to resolve or map a known IP address to a MAC a known IP address to a MAC sublayer address sublayer address

ARP cache ARP cache Local ARP Local ARP

Page 61: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres
Page 62: Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres

Summary

TCP/IP and OSITCP/IP and OSIApplication protocols Application protocols Transport layer Transport layer ICMP, ARP, RARPICMP, ARP, RARP