Protocols and Packet Switching

You can read this note directly if you know that networks carry data between devices. This note explains the rules and transmission model that make communication work.

Beginner Problem

Two computers can be connected by a cable or wireless link and still fail to communicate meaningfully if they do not follow the same rules.

Example:

One side sends: 01001000 01001001
The other side must know whether those bytes mean text, a number, an image fragment,
or part of a larger message.

Protocols provide the shared rules needed to interpret and manage communication.

Why Protocols Are Needed

A protocol is a set of communication rules.

Protocols define things such as:

  • message format;
  • addressing;
  • ordering;
  • error handling;
  • when a connection starts and ends;
  • what each side should do after receiving data.

Without a shared protocol, two devices may send bytes but fail to understand each other.

TCP/IP Roles

ProtocolMain role
IProutes packets using IP addresses
TCPprovides reliable ordered delivery between processes
Ethernetsends frames across a local network link
HTTPdefines web request and response messages
SMTPsends email between mail systems
POP/IMAPretrieves or manages email for users

Beginner idea: protocols work together. A web request may use HTTP messages carried over TCP, which uses IP packets.

Layered example:

Layer of ideaExample role
application messageHTTP says what web resource is requested
transportTCP keeps the byte stream reliable and ordered
networkIP routes packets to the destination host
local linkEthernet or Wi-Fi carries frames on the local network

TCP/IP Layer Model

Some exam questions refer to TCP/IP layers by name. Use this as a syllabus-level model, not as a full professional networking course.

TCP/IP layerMain responsibilityExample protocols or technologies
applicationrules for application messages and servicesHTTP, SMTP, DNS
transportprocess-to-process delivery, reliability where neededTCP, UDP
internetaddressing and routing packets between networksIP
network accessmoving frames across the local physical or wireless linkEthernet, Wi-Fi

The key idea is separation of responsibilities. For example, HTTP defines the web request, TCP manages reliable ordered delivery, IP routes packets across networks, and Ethernet or Wi-Fi carries data across the local link.

Common exam wording:

If asked about…Answer focus
protocolagreed rules for communication
IPaddressing and routing packets
TCPreliable ordered delivery between processes
routerforwarding packets between networks
layerseach layer handles a different part of communication

Packet Switching

Packet switching splits a message into smaller packets.

Caption: Packet-switched networks forward packets through routers toward the destination.

Each packet can include:

  • source address;
  • destination address;
  • sequence information;
  • protocol information;
  • payload data.

At the destination, packets are reassembled into the original message where needed.

Beginner analogy: a long document can be mailed as several envelopes. Each envelope needs an address and ordering information. The receiver can put the pieces back together.

Routing

Routers forward packets from one network to another. A router does not need to know the whole original message. It uses packet header information and routing information to choose the next hop.

Trace idea:

StepWhat happens
1sender splits data into packets
2each packet gets header information
3routers forward packets toward destination
4packets may arrive in a different order
5destination uses protocol information to handle or reassemble data

Packet Loss

Packets can be lost because of congestion, errors, or network failure.

TCP can detect missing data and arrange retransmission. This is one reason TCP is used for applications where reliable ordered delivery matters.

Not every protocol handles loss the same way. The syllabus focus here is that packet-switched networks can lose packets, and higher-level protocols may need to detect and recover from that.

Packet Switching Versus Circuit Switching

FeaturePacket switchingCircuit switching
pathpackets may take different routesdedicated path is reserved
resource useshared between many communicationsreserved for one communication
good forbursty data such as internet trafficcontinuous dedicated communication
weaknesspackets may be delayed or lostinefficient if reserved path is idle

Common Mistakes

  • Saying TCP and IP do the same job.
  • Saying every packet must take the same route.
  • Forgetting that packets contain headers as well as data.
  • Thinking packet switching guarantees no packet loss.
  • Treating HTTP as a low-level routing protocol.

Check Your Understanding

  1. Why are protocols needed?
  2. What is the role of IP?
  3. What is the role of TCP?
  4. Why can packet switching use network resources efficiently?

Answers:

  1. They provide agreed rules so devices can interpret messages correctly.
  2. Routing packets using IP addresses.
  3. Reliable ordered delivery between processes.
  4. Packets from many communications can share network links.