Network fundamentals

  • 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
  • Understand how port numbers are used to differentiate applications/services
  • 3.1.3 Understand how and why communication over networks is broken down into different layers
  • 3.1.11 Explain how data is transmitted by packet switching.
  • Understand difference between TCP and UDP

Instructions for online Class


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

Students to update their IB Notes on how TCP/IP  work to send packets across the internet. Able to identify the 5 different levels in the TCP/IP model with examples of protocols at each layer.

***  Assessment Using Time Slot Students will be asked questions on content covered today.

3.1.11 Explain how data is transmitted by packet switching.

3.1.3 Understand how and why communication over networks is broken down into different layers

What is packet switching?

Packet switching is a method of transferring the data to a network in form of packets. In order to transfer the file fast and efficient manner over the network and minimize the transmission latency, the data is broken into small pieces of variable length, called Packet. At the destination, all these small-parts (packets) has to be reassembled, belonging to the same file. A packet composes of payload and various control information.

Packet switching uses Store and Forward technique while switching the packets; while forwarding the packet each hop first store that packet then forward. This technique is very beneficial because packets may get discarded at any hop due to some reason. More than one path is possible between a pair of source and destination. Each packet contains Source and destination address using which they independently travel through the network. In other words, packets belonging to the same file may or may not travel through the same path. If there is congestion at some path, packets are allowed to choose a different path possible over existing network.

Advantage of Packet Switching over Circuit Switching

  • More efficient in terms of bandwidth, since the concept of reserving circuit is not there.
  • More reliable as destination can detect the missing packet.
  • More fault tolerant because packets may follow a different path in case any link is down, Unlike Circuit Switching.


  • 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


Port Number







SMTP ( email) 




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


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





  • 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 ?


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

TCP/IP 5 Layer Model

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:

  • Take a package, wrap it and address it. Send it to the destination
  • 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


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

  • The destination address
  • The source address
  • Total number of pieces
  • The sequence number (Seq#) needed to enable reassembly

TCP Session

  • SYN - the first application (the client) sends a synchronize packet to the host. The message contains a random sequence number, which has been set by the client.
  • SYN-ACK - the host responds to the client. It increases the sequence number from the client by one and sends it back in the message as an acknowledgement number. Also, the response message contains another sequence number chosen randomly by the host.
  • ACK - the client sends an acknowledgement message to the host. The message contains both received numbers increased by one.

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:

  • FTP
  • SMTP


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.