3.3.7

Packet Switching

Test yourself

What's in a Packet?

When data is split into packets, it is bundled with extra information which tries to make sure that it will reach its destination safely.

Illustrative background for PayloadIllustrative background for Payload ?? "content

Payload

  • The payload of a packet is the actual data that was intended to be sent.
Illustrative background for HeaderIllustrative background for Header ?? "content
  • A header is also attached to the packet.
  • A header includes useful information such as:
    • The intended recipient's IP address.
    • The sender's IP address.
    • The sequence number (so we can re-arrange the packets into the correct order at the other end).
    • A checksum (to make sure the data was sent correctly).

How do Packets get Routed?

Packet switching is the process of breaking data down into packets, sending them across the Internet to another computer, and then re-assembling the data.

Illustrative background for Sender's local area networkIllustrative background for Sender's local area network ?? "content

Sender's local area network

  • The sender will generate data in an application on their computer.
    • This happens at the application layer.
  • The data is split into packets of data.
    • This happens at the transport layer.
  • Internet Protocol adds IP addresses to each packet.
    • This happens at the Internet layer.
  • Packets are grouped into frames and sent to the router on the LAN.
    • This happens at the Network layer.
Illustrative background for Over the InternetIllustrative background for Over the Internet ?? "content

Over the Internet

  • The sender's router inspects the packet to determine if the destination IP is on the current LAN.
    • If it is not then it will send the packet onto the Internet (or other wide area network).
    • This happens at the Internet layer.
  • Each packet is sent from the sender's router to the destination router via connected routers.
    • The path of each packet can be different, which maximises efficient use of the network by avoiding bottlenecks.
Illustrative background for Recipient's local area networkIllustrative background for Recipient's local area network ?? "content

Recipient's local area network

  • Because they have taken different paths, the packets at the destination will be in the wrong order.
    • These packets are unpackaged and reassembled into the correct order using the sequence number of each packet.

Did my Data Arrive Safely?

Interference across a network can cause data to become corrupted (changed) as it is transmitted to the recipient.

Illustrative background for Lost packetsIllustrative background for Lost packets ?? "content

Lost packets

  • Some packets might get lost within the network.
  • Each packet transfer will have a certain timeout, which is the maximum amount of time that the packet transfer is expected to take.
  • If the time taken is more than the timeout, then we send a timeout signal to the sender to ask them to re-send the packet.
Illustrative background for ChecksumsIllustrative background for Checksums ?? "content

Checksums

  • A checksum is a piece of data which is generated from the payload.
  • When data is assembled into packets, we calculate the checksum and send this along with the packet.
  • When the data is received, the recipient can re-calculate the checksum from the data they receive and compare it to the checksum they received.
    • If the values are different, then some of the data was corrupted.
    • They can then request the data again.
Illustrative background for Confirmation messageIllustrative background for Confirmation message ?? "content

Confirmation message

  • If all packets have been successfully received, then a confirmation message is sent to the sender.
  • This lets them know that there were no issues in transmission that they might need to fix.

Jump to other topics

1Components of a Computer

2Software & Software Development

3Exchanging Data

4Data Types, Data Structures & Algorithms

5Legal, Moral, Cultural & Ethical Issues

6Elements of Computational Thinking

6.1Thinking Abstractly

6.2Thinking Procedurally

6.3Thinking Logically

7Problem Solving & Programming

8Algorithms

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson