960 likes | 1.14k Views
TCP/IP Refresher. Prabhaker Mateti (ack: Many many sources …). TCP/IP ?. TCP = Transmission Control Protocol IP = Internet Protocol Almost always includes other protocols: UDP, User (Unreliable) Datagram ICMP, Internet Control Message ARP, Address Resolution. What’s a Protocol?.
E N D
TCP/IP Refresher Prabhaker Mateti (ack: Many many sources …)
TCP/IP ? • TCP = Transmission Control Protocol • IP = Internet Protocol • Almost always includes other protocols: • UDP, User (Unreliable) Datagram • ICMP, Internet Control Message • ARP, Address Resolution Mateti, TCP/IP Refresher
What’s a Protocol? • An agreed upon convention for communication. • Protocols must be formally defined and unambiguous Mateti, TCP/IP Refresher
Layers The relative heights indicate the level of functionality. Mateti, TCP/IP Refresher
Unix is a Layered System Applications Libraries System Calls Kernel Mateti, TCP/IP Refresher
Layers • The routines/methods of Layer N will not call Layer N+1. • The routines/methods of Layer N typically do call the same layer methods. • The routines/methods of Layer N typically do call Layer N-1 methods. Mateti, TCP/IP Refresher
DoD model: Four Layers • Network Access Layer: Delivery over physical media in use. • Internet Layer: Delivery across different physical networks that connect source and destination machines. • Host-to-Host Layer: Connection rendezvous, flow control, retransmission of lost data, etc. TCP and UDP protocols are in this layer. • Process Layer: User-level functions, such as SMTP, FTP and rlogin. Mateti, TCP/IP Refresher
OSI Reference Model Seven Layers 7. Application 6. Presentation 5. Session 4. Transport 3. Network 2. Data Link 1. Physical Mateti, TCP/IP Refresher
TCP/IP & OSI • In OSI reference model terminology -the TCP/IP protocol suite covers the network and transport layers. • TCP/IP can be used on many data-link layers (can support many network hardware implementations). Mateti, TCP/IP Refresher
Process Process Process Layer TCP UDP Transport Layer ICMP, ARP & RARP IP Network Layer 802.3 Data-Link Layer Mateti, TCP/IP Refresher
Physical Layer • Responsibility: • transmission of raw bits over a communication channel. • Issues: • mechanical and electrical interfaces • time per bit • distances Mateti, TCP/IP Refresher
Data Link Layer - Data Link Control • Responsibility: • provide an error-free communication link • Issues: • framing (dividing data into chunks) • header & trailer bits • addressing 10110110101 01100010011 10110000001 Mateti, TCP/IP Refresher
The Data Link Layer - The MAC sub layer • Medium Access Control (MAC) - needed by multi-access networks. • MAC provides DLC with “virtual wires” on multi-access networks. Mateti, TCP/IP Refresher
Ethernet: A Data-Link Layer • IEEE 802.3 • Variety of physical layers. • Multi-access (shared medium). • Interface has a unique 6-byte hardware address. (E.g. 00-D0-09-E8-08-61) • The broadcast address is all 1’s. • Addresses are assigned to vendors by a central authority. Mateti, TCP/IP Refresher
Preamble Destination Address Source Address Len DATA CRC An Ethernet Frame • Preamble is a sequence of alternating 1’s and 0’s used for synchronization. • CRC is Cyclic Redundancy Check 8 bytes 6 6 2 0-1500 4 Mateti, TCP/IP Refresher
Ethernet Addressing • Each NIC 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. • Some NICs can be programmed to recognize multicast addresses. Mateti, TCP/IP Refresher
The Network Layer • Responsibilities: • path selection between systems (routing). • subnet flow control. • fragmentation & reassembly • translation between different network types. • Issues: • packet headers • virtual circuits Mateti, TCP/IP Refresher
The Transport Layer • Responsibilities: • provides virtual end-to-end links between peer processes. • end-to-end flow control • Issues: • headers • error detection • reliable communication Mateti, TCP/IP Refresher
The Session Layer • Responsibilities: • establishes, manages, and terminates sessions between applications. • service location lookup • Many protocol suites do not include a session layer. Mateti, TCP/IP Refresher
The Presentation Layer • Responsibilities: • data encryption • data compression • data conversion • Many protocol suites do not include a Presentation Layer. Mateti, TCP/IP Refresher
The Application Layer • Responsibilities: • anything not provided by any of the other layers • Issues: • application level protocols • appropriate selection of “type of service” Mateti, TCP/IP Refresher
Layering & Headers • Each layer needs to add control information. • Typically prefixed to the data before passing on to the lower layer. Mateti, TCP/IP Refresher
Headers DATA Process Process Transport H DATA Transport H H DATA Network Network Data Link H H H DATA Data Link Mateti, TCP/IP Refresher
Example Headers • Physical: no header • Data Link: • address of the receiving endpoints • address of the sending endpoint • length of the data • checksum Mateti, TCP/IP Refresher
protocol suite version type of service length of the data packet identifier fragment number time to live Network layer header - examples • protocol • header checksum • source network address • destination network address Mateti, TCP/IP Refresher
Connecting Networks • Repeater: physical layer • Bridge: data link layer • Router: network layer • Gateway: network layer and above. Mateti, TCP/IP Refresher
Repeater • Copies bits from one network to another • Does not look at any bits • Allows the extension of a network beyond physical length limitations REPEATER Mateti, TCP/IP Refresher
Bridge • Copies frames from one network to another • Can operate selectively - does not copy all frames (looks at data-link headers). • Extends the network beyond physical length limitations. BRIDGE Mateti, TCP/IP Refresher
ROUTER Router • Copies packets from one network to another. • Makes decisions about what route a packet should take (looks at network headers). Mateti, TCP/IP Refresher
Gateway • Operates as a router • Data conversions above the network layer. • Conversions: • encapsulation - use an intermediate network • translation - connect different application protocols • encryption - could be done by a gateway Mateti, TCP/IP Refresher
Encapsulation Example • Provides service connectivity even though intermediate network does not support protocols. Gateway Gateway Mateti, TCP/IP Refresher
Translation • Translate from green protocol to brown protocol Gateway Mateti, TCP/IP Refresher
Secure Network Secure Network Encryption/Decryption Gateways ? GW GW ? ? InsecureNetwork Encryption gateway Mateti, TCP/IP Refresher
Hardware v. Software • Repeaters are typically hardware devices. • Bridges can be implemented in hardware or software. • Routers and gateways are typically implemented in software so that they can be extended to handle new protocols. • Many workstations can operate as routers or gateways. Mateti, TCP/IP Refresher
Modes of Service • connection-oriented vs. connectionless • sequencing • error-control • flow-control • byte stream vs. message based • full-duplex vs. half-duplex. Mateti, TCP/IP Refresher
Connection-Oriented Service • establishment of a logical connection between two processes. • transfer data • terminate connection. Mateti, TCP/IP Refresher
Connectionless Service • Sends independent messages. Mateti, TCP/IP Refresher
Sequencing • Sequencing provides support for an order to communications. • A service that includes sequencing requires that messages (or bytes) are received in the same order they are sent. Mateti, TCP/IP Refresher
Error Control • Some services require error detection. • Checksums provide a simple error detection mechanism. • Error control sometimes involves notification and retransmission. Mateti, TCP/IP Refresher
Flow Control • Flow control prevents the sending process from overwhelming the receiving process. • Flow control can be handled in a variety of ways. Mateti, TCP/IP Refresher
Byte Stream vs. Message • Byte stream implies an ordered sequence of bytes with no message boundaries. • Message oriented services provide communication service to chunks of data called datagrams. Mateti, TCP/IP Refresher
Full- v. Half-Duplex • Full-Duplex services support the transfer of data in both directions. • Half-Duplex services support the transfer of data in one direction. Mateti, TCP/IP Refresher
End-to-End v. Hop-to-Hop Service modes, flow control and error control can be • Either between endpoints of the communication. • Or between consecutive nodes on the path between the endpoints. Mateti, TCP/IP Refresher
Process A Process B End-to-End Mateti, TCP/IP Refresher
Process A Process B Hop-by-Hop Mateti, TCP/IP Refresher
Buffering • Buffering can provide more efficient communications. • Buffering is most useful for byte stream services. Process A Send Buffer Recv. Buffer Process B Mateti, TCP/IP Refresher
Addresses • Physical Layer: no address necessary • Data Link Layer: address must be able to select any host on the network. • Network Layer: address must be able to provide information to enable routing. • Transport Layer: address must identify the destination process. Mateti, TCP/IP Refresher
Broadcasts • Broadcast = sending a message from one host to all other hosts on the network. • A special address called the “broadcast address” is created. • Some popular network services are based on broadcasting (YP/NIS, rup, rusers) Mateti, TCP/IP Refresher
The IP in TCP/IP • IP is the network layer • packet delivery service (host-to-host). • translation between different data-link protocols. Mateti, TCP/IP Refresher
IP Datagrams • IP provides connectionless, unreliable delivery of IP datagrams. • Connectionless: each datagram is independent of all others. • Unreliable: there is no guarantee that datagrams are delivered correctly or at all. Mateti, TCP/IP Refresher