• Describe how TCP/IP Work
  • Understand how port numbers are used to differentiate applications/services 
  • Students are able to describe how IP and TCP work together in sending a message

Some Students   may be asked to stand up and provide a brief explanation of how a message is sent with reference to TCP/IP   

Activity:

Find an online trace router and enter some web site url and watch the route taken

Students to update their web blog with page on how TCP/IP  work to send packets across the internet. Also explain the purpose of OSI. If not complete in class homework for Friday  


  • Think of IP as the protocol that gets information from one machine to another. Then TCP can be thought of as directing the packet to the correct program on the receiving machine. 
  • Each program / service is assigned  a port number 
  • The IP address coupled with the PORT Number can uniquely identify a program/service running on a specific machine
  • TCP guarantees delivery, IP only cares about routing the message or finding the best /optimum [path from machine to machine

Service

Port Number

HTTP

80

HTTPS

443

DNS

53

SMTP ( email) 

25

FTP

21


Receiver IP

IP Layer Wrapped around - What Machine /IP address is going to get this packet 

25 1/4

TCP Layer Wrapped around Going to port 25 and this is packet 1/4

<DATA>

Sending a simple Email  Assume 4 packets

Packet A

Packet B

Packet C

Packet D

All bundled together and the routed thru the network using IP Protocol

Receiver IP

Receiver IP

25 1/4

 --------> Route VIA IP

25 1/4

<DATA>

<DATA>

SENDER 

RECEIVER

  • 1
    The Receiver deconstructs it looks at the IP layer and knows that the message is for this machine
  • 2
    Data to be received on PORT 25 and first part of four 1/4
  • 3
    Stores that and takes note received 1/4

Because IP protocol the next packet may be packet 3, but TCP will check and put in order.


What happens if not all packets are received ?


  • Describe how TCP/IP Work
  • Understand how port numbers are used to differentiate applications/services 
  • Students are able to describe how IP and TCP work together in sending a message

Some Students   may be asked to stand up and provide a brief explanation of how a message is sent with reference to TCP/IP   

Activity:

Find an online trace router and enter some web site url and watch the route taken

Students to update their web blog with page on how TCP/IP  work to send packets across the internet. Also explain the purpose of OSI. If not complete in class homework for Friday  


  • Think of IP as the protocol that gets information from one machine to another. Then TCP can be thought of as directing the packet to the correct program on the receiving machine. 
  • Each program / service is assigned  a port number 
  • The IP address coupled with the PORT Number can uniquely identify a program/service running on a specific machine
  • TCP guarantees delivery, IP only cares about routing the message or finding the best /optimum [path from machine to machine

Service

Port Number

HTTP

80

HTTPS

443

DNS

53

SMTP ( email) 

25

FTP

21


Receiver IP

IP Layer Wrapped around - What Machine /IP address is going to get this packet 

25 1/4

TCP Layer Wrapped around Going to port 25 and this is packet 1/4

<DATA>

Sending a simple Email  Assume 4 packets

Packet A

Packet B

Packet C

Packet D

All bundled together and the routed thru the network using IP Protocol

Receiver IP

Receiver IP

25 1/4

 --------> Route VIA IP

25 1/4

<DATA>

<DATA>

SENDER 

RECEIVER

  • 1
    The Receiver deconstructs it looks at the IP layer and knows that the message is for this machine
  • 2
    Data to be received on PORT 25 and first part of four 1/4
  • 3
    Stores that and takes note received 1/4

Because IP protocol the next packet may be packet 3, but TCP will check and put in order.


What happens if not all packets are received ?


Key Questions

What is a protocol ?

layered protocol stacks

This layered arrangement is not confined to networking, and how it works is probably best understood if you compare it to real life example.

We will divide the task into two distinct processes as follows:

  • 1
    Take a package, wrap it and address it.
    Send it to the destination
  • 2
    Receive the package
    Deliver it to the recipient

Why not use one single protocol to transfer data from one application to another?

The answer is that any of the layers/tasks can be changed without affecting the other layers.

One of the great benefits of TCP/IP is that it provides interoperable communications between all types of hardware and all kinds of operating systems.

A sign of the network’s success is the confusion that surrounds the term internet. Originally it was used only as the name of the network built upon IP. Now internet is a generic term used to refer to an entire class of networks. An internet (lowercase “i”) is any collection of separate physical networks, interconnected by a common protocol, to form a single logical network. The Internet (uppercase “I”) is the worldwide collection of interconnected networks

TCP

The most common protocol used in the transport layer is TCP (Transmission Control Protocol). This is a connection oriented protocol. TCP offers reliable, peer-acknowledged, ordered, session-based connectivity between two hosts.

TCP Reliability

During sending data, TCP assures that data has been provided to the recipient. The receiver checks if the received packet was intact during transmission (by checking the checksum of the data) and, if so, the receiver confirms it by sending an acknowledgement to the sender. If the sender doesn't receive the acknowledgement for a message within some time period, it will resend the lost packet.

After several unsuccessful attempts, TCP assumes that the receiver is unreachable and informs the application layer that the transmission has failed.

TCP Ordering

The TCP header contains a field with the message sequence number. The sequence number is incremented by one for every message sent. During receiving data, TCP rearranges incoming packets and put them in the right order. Thanks to that, the application layer doesn't need to care about the ordering of network packets.

TCP Header

TCP Session

TCP Usage

TCP is widely used by protocols and applications that require high reliability. It is not as fast as UDP but, if configured properly, it still provides quite good speed together with high quality of transmitted data.

There are a lot of application layer protocols that are most mostly used together with TCP. Some of the most popular ones are:

  • HTTP, HTTPS
  • FTP
  • SMTP
  • Telnet
  • UDP

    The second popular protocol that is used in the transport layer is UDP (User Datagram Protocol or Universal Datagram Protocol), a simpler, connectionless protocol. One program just sends some packages to another, without creating any kind of relation between them.

    Due to its simplicity UDP is faster than TCP. On the other hand, it doesn't provide such reliability as TCP. There is no guarantee that the messages would reach the receiver. UDP doesn't deliver packets in the same order that they were sent. It is up to the application to check that the received messages are intact and to deal with data in the correct order.

    UDP Usage

    UDP is preferred if unimportant data is transmitted or the communication has to be really fast. For example, UDP is used for DNS requests (because of a huge number of clients sending many short messages to relatively few DNS servers). Similarly, during audio and video transmission the loss of some packets is not so damaging to the receiver.

    There are a lot of application layer protocols that use UDP, for example:

    Analogy between the postal network and TCP/IP

    Both the post office and Internet separate responsibility into independent layers. Here is a comparison of the operation of the post office and the TCP/IP protocols.

    Application layer

    Postal network: Someone writes a letter to a friend in New York, addresses it, and drops it in a mailbox. The friend opens the letter and reads it with a smile on his face. Neither of them think about how the letter got there -- did it go in a Ford or Chevrolet truck to the airport, what was the name of the person driving the truck, did it fly straight to New York or was it transferred to another plane in Kansas City, etc.? They are working at the application layer -- getting work done. They are communicating directly with each other, unaware of the underlying delivery mechanism.

    TCP/IP: A user retrieves a Web page from a server in New York by typing a URL into a browser and clicking the enter key. The server receives the request, finds the page on its hard drive and sends it back to the user. Neither the user nor the client or server software is aware of the way the messages were delivered -- did they go over wireless connections, how many routers did they pass through, who manufactured the routers, was the server a PC or a rack-mounted machine, was it running IIS or Apache, etc.? There are many application layer protocols.

    Transport layer

    Postal network: If you accidentally write the wrong address on a letter to someone in Kansas, a postal employee in Kansas will stamp it "address unknown" and it will be returned to you. You will also be informed if a registered letter cannot be delivered. You will be unaware of the details of the error message delivery system, and it will be up to you to decide what to do next.

    TCP/IP: Transport layer software establishes a connection between a client and server then monitors that connection for errors. It also slows transmission if it gets too fast to handle at the other end. Transport layer software is not concerned with how the data is actually moved from one point to the other -- that is the responsibility of lower level software. There are two transport layer protocols TCP (reliable) and UDP (unreliable, but fast). If TCP tries repeatedly and errors persist, it informs its "boss," the application program.

    Internet layer

    Postal network: Airplanes move letters between cities. The pilot does not pay attention to who the letters are addressed to or from, what they say, or whether they contain photos and drawings or only written words.

    TCP/IP: Internet layer programs move data between networks. IP is the internet layer protocol. IP software ignores the data, and it does the same thing with a packet whether it comes from the Dalai Lama or your mother in law. Once the data gets to its destination local area network (LAN), it is handed over to data linklayer software or firmware for delivery to the proper computer.

    Data link layer

    Postal network: Trucks move letters within a city.

    TCP/IP: Data Link layer programs move (incoming and outgoing) data within LANs. Ethernet is the most common data link protocol. A data link program is not concerned with how outgoing data will be handled once it leaves the LAN or how incoming data got there. That is the responsibility of the internet layer software.

    Physical layer

    Postal network: People use pens and paper to write letters, and the recipient reads them using reflected light and sometimes glasses.

    TCP/IP: Physical layer protocols specify the means of representing ones and zeros (bits). The method of transmitting them between two points using wire, radio, fiber, etc. is also specified. There are many ways to make ones and zeros and many ways to transmit them so there are many physical layer protocols.

    Breaking the rules

    These are ideal descriptions. In real life, a postman might read a letter or decide not to deliver it. On the Internet, a router may be programmed to process packets from the owner of a competing service slowly or to send copies of packets containing certain content to a government security agency. In the postal network, there are laws against tampering with mail. Some people advocate network neutrality laws against differential treatment of packets on the Internet.