7  Data networks and packet switching

  • You have seen that data packets are responsible for transferring data across networks, and require IP addresses to do so. The box below describes in more detail how a PC uses packets to retrieve a webpage (without considering the action of NAT).

How a PC uses packets to retrieve a webpage

Figure 13
  • The user within the home LAN enters a URL such as www.bbc.co.uk [Tip: hold Ctrl and click a link to open it in a new tab. (Hide tip)] into the browser on their PC, which has an IP of The PC then creates an IP packet addressed to the local DNS server, as it needs to resolve the correct IP address for the BBC web server:
Figure 14
  • The packet uses the IP address of the home PC as its source and the IP address of the DNS server as its destination. The packet contains a request from the DNS for the IP address of the BBC web server. Note that the ‘type’ field of the packet identifies the User Datagram Protocol (UDP), which is responsible for segmenting the DNS request so that the IP can encapsulate it within a packet.
  • The PC identifies that the packet is leaving the LAN, as the source and destination networks are within different IP networks, so it forwards the packet towards the default gateway it has learnt via DHCP:, which is the LAN interface of the home router.
  • The router examines its routing table, which identifies all the IP networks the router can forward packets to. It is then able to identify an exit interface to use in order to forward the packet towards the destination network identified in the packet.
  • The packet may be required to pass through multiple routers, but it eventually arrives at the DNS server, which examines the DNS request and identifies the IP address that maps to the URL. It then creates a new packet containing a response, which is forwarded back to the home PC:
  • The packet returns to the home router, which forwards it to the PC. The PC now has the correct IP address for the URL it wishes to contact, so it can construct a new packet containing the web server as a destination and carrying an HTTP GET message requesting webpage content. Note that the protocol type has changed to Transmission Control Protocol (TCP). Like UDP it performs segmentation, but also provides reliability mechanisms to protect against data errors if packets are lost or damaged during transmission.
  • Once again, the PC realises that the packet’s destination is not on the local LAN and forwards it to the home router, which in turn forwards the packet to the ISP and onto the Internet via its WAN interface. The packet passes through several routers as it heads towards the web server, with each router checking the destination address within the packet and forwarding appropriately.
  • Once the web server receives the packet, it examines the GET message to see which particular page is required, and then returns the webpage as HTML within a series of packets addressed to the home PC:
  • The process explained above is facilitated by routers within both the home network and within the Internet itself. Routers forward packets based on the destination address they find in the IP packet header, and the information they themselves know about how to reach the identified destination.
  • Routers store information internally about destination networks in tables called ‘routing tables’. The process of accepting a packet on an incoming interface, making a decision on what to do with it, and then sending it towards another interface is called packet switching. To learn more about packet switching watch the following video.
Interactive feature not available in single page view (see it in standard view).
  • The networks which make up the Internet are complex, and there are often multiple different paths that routers can use to packet switch towards a destination. When faced with multiple paths, routers are capable of deciding which path to choose based on a variety of network characteristics, a process known as routing.

6  Using DNS at home

8  Activities