Chapter 3, IP (adapted from Microsoft Press Chapter Outlines)

y    1.   IP

              A.   IP is connectionless because it does not establish a session before exchanging data.

              B.   IP is unreliable because it does not guarantee delivery.

              C.  IP does not require acknowledgment when data is received. Acknowledgment is responsibility of a higher-layer protocol.

              D.  IP datagram fields are added to the header.

                    1.   Source IP Address

                    2.   Destination IP Address

                    3.   Protocol (whether TCP or UDP)

                    4.   Checksum

                    5.   Time to Live

              E.   IP determines whether the destination is a local or a remote address. IP transmits the packet directly to the host for a local address or to a router if it is a remote address.

y    2.   IP on the Router

              A.   IP decrements the TTL by at least one (1) as it passes through a router. It could be more if the packet is stuck at the router due to congestion. When TTL reaches zero, the packet is discarded.

              B.   IP might fragment the packet into smaller packets if the packet is too large for the underlying network (routers, gateways, etc.).

              C.  If a packet is fragmented, IP creates a new header for the packet.

                    1.   Flag to indicate the other packets follow

                    2.   Fragment ID to identify fragments belonging together

                    3.   Fragment Offset to tell the receiving host how to reassemble the packet

              D.  IP calculates a new checksum.

              E.   IP obtains the destination hardware address of the next router.

              F.   IP forwards the packet.

              G.  Process is repeated until the packets arrive at the destination.

y          H.   IP packet structure

                    1.   Version of IP: Four bits

                    2.   Header Length: Four bits indicate the number of 32-bit words in the IP header; minimum size is 20 bytes. (Always a multiple of four bytes with unused bytes padded with zeroes)

                    3.   Type of Service: Eight bits

                    4.   Total Length: Sixteen bits to indicate total length of the IP datagram including IP header

                    5.   Identification: Sixteen bits to identify this packet, used to identify fragmented packets that go together

                    6.   Fragmentation Flags: Three bits reserved as flags for fragmentation process, but only two in current use

                    7.   Fragment Offset: Thirteen bits as offset counter to indicate the position of the fragment relative to the original IP payload; if unfragmented, the fragment offset is 0x0

                    8.   Time to Live: Eight bits to indicate the amount of time or hops an IP packet can travel before being discarded

                    9.   Protocol: Eight bits to identify the IP client protocol

                    10.  Header Checksum: Sixteen bits as checksum on IP header only

                    11.  Source Address: 32-bit IP of originating host

                    12.  Destination Address: 32-bit IP of destination host

                    13.  Options and Padding: A multiple of 32 bits used to store IP options

        3.   Summary

              A.   IP is connectionless protocol that addresses and routes packets between hosts.

              B.   IP is unreliable because delivery is not guaranteed.

              C.  Packets destined for a local host are sent to the local host.

              D.  Packets destined for a remote host require IP to check the local routing table for a route and to use the default gateway in the event that there is no route in the routing table for the remote host.

      Chapter 3, TCP

y    1.   TCP

              A.   TCP is reliable, connection-oriented delivery service.

              B.   Session must be established before transmission of data.

              C.  Data is transmitted in segments using byte-stream communication.

              D.  Sequence number is assigned to each segment transmitted.

              E.   An acknowledgment (ACK) verifies that the other host received the data.

              F.   Receiving host must return an acknowledgment within a specific period.

              G.  Data is retransmitted if the sender does not receive an acknowledgment.

y    2.   Ports

              A.   Sockets applications identify themselves uniquely within a computer by using a protocol port number.

              B.   Ports can be 0–65536. Note: Keep in mind that there are 64K TCP ports and 64K UDP ports.

              C.  Ports for client-side applications are dynamically assigned by the operating system.

D.     Ports for well-known server-side applications are assigned by Internet Assigned Numbers Authority (IANA). Well-known port numbers range from 1–1024.
Some well-known ports to be aware of are:

          FTP     21

          Telnet  23

          SMTP  25

          DNS    53

          HTTP   80

          POP3  110

        3.   Sockets

A.      A socket, similar to a file handle, functions as an endpoint for network communication.

B.     Application creates a socket by specifying the IP address of the host, the protocol (TCP or UDP), and the port the application is using.  In other words, a socket={IPAddress,protocol,port}.

y    4.   TCP Three-Way Handshake

              A.   Initiating host requests a session by sending a segment with the synchronization (SYN) flag set to on.

              B.   Receiving host acknowledges request by sending back a segment with the synchronization (SYN) flag set to on, a sequence number to indicate the starting byte for a segment it may send, and an acknowledgment (ACK) with the byte sequence number of the next segment it expects to receive.

              C.  The requesting host sends back a segment with the acknowledged sequence number and acknowledgment number.

                   

        6.   Summary

              A.   TCP is a reliable, connection-oriented delivery service.

              B.   Socket applications use a unique port.

              C.  TCP session is initialized and ended through a three-way handshake.

              D.  TCP uses sliding windows to buffer data for transmission between two hosts.

      Chapter 3, UDP

y    1.   User Datagram Protocol (UDP)

              A.   UDP is used by applications that do not require an acknowledgment of data receipt (connectionless).

              B.   To use UDP, applications must supply the IP address and port number of the destination application.

              C.  A port functions as a multiplexed message queue; it can receive multiple messages at a time.

y          D.  UDP packet structure

                    1.   Source Port: UDP port of sending host

                    2.   Destination Port: UDP port of destination host

                    3.   Message Length: Size of the UDP message; the minimum UDP packet is just the header: eight bytes

                    4.   Checksum

        2.   Summary

              A.   UDP is a connectionless datagram service that does not guarantee delivery of packets.

              B.   It is used by applications that do not require acknowledgment of data receipt.