On the massive network known as the Internet, computing devices send all kinds of messages to other computing devices. A message might be a tiny ping to check if another device is online or a message could be an entire webpage.
But there's a limit to how large a message can be, since there's a limit to how much data can be reasonably transmitted at once by the physical network connections between devices.
That's why many networking protocols split each message into multiple small packets. The Internet Protocol (IP) describes the structure of the packets that whizz around the Internet.
Each IP packet contains both a header (20 or 24 bytes long) and data (variable length). The header includes the IP addresses of the source and destination, plus other fields that help to route the packet. The data is the actual content, such as a string of letters or part of a webpage.
A diagram of an IP packet. The header is 24 bytes long and contains 15 fields, including 4 bytes for source IP address and 4 bytes for destination IP address. The payload is variable length.
You can think of IP packets like postal letters: the header is the envelope with all the routing information that's needed by the post office, and the payload is the letter that's read only by the recipient.
Diagram of an IP packet as a postal letter. An envelope is shown with "Source IP address" as the return address and "Destination IP address" as the mailing address. The envelope is then shown in an open state, with a letter that says "Data" poking out.
Just like the postal system routes postal letters around the world, the Internet Protocol routes IP packets around the Internet.
In the next article, we'll learn much more about routing on the Internet.
Want to join the conversation?
- If the source and destination IP address lines within the IP header are each only 4 bytes (32 bits) long, how is it possible for the header to store IPv6 addresses, which are 128 bits long?(27 votes)
- Nice catch!
The headers of IPv6 packets are 40 bytes (unlike IPv4 with 20 -24 bytes). Just imagine the image like currently only instead of having a single line for the source and destination IP you have a block of lines for each.(27 votes)
- i have an ip. does that mean random peoples data packets are traveling through my router?(4 votes)
- Pretty sure not. If an unknown packet was to somehow get into your router, it would most likely be dropped. All packets travel over your ISP's centers and the destination's servers. A way to know is to check the route trace. If you are on Windows, go to command prompt and type 'tracert google.com'. The first couple of hops should be your ISP routing it to a Google server. The other IP address seem to be Google datacenter IPs.(2 votes)
- what are IP packets used for?(1 vote)
- They store the data that is sent over a network. For example, when we both wrote on the KA forum, our writing was decomposed into packets, each storing our messages, and these packets were delivered to KA.
Hope this helps!(6 votes)
- can't we use 5g?(1 vote)
- We do use 5g, it's just that 5g is a technology that "sits below" IP. You can basically imagine it like an hour glass with applications like messengers, email, khan academy at the top, technologies like ethernet, wi-fi, 5g at the bottom and TCP/IP in between. The top and the bottom keep changing, new applications to do things with and new technologies for systems to communicate get developed and TCP/IP makes sure that systems can keep communicating with each other despite those changes.(5 votes)
- where does the port number get stored?(1 vote)
- The source port number and destination port number are stored in the header of the TCP segment. If you are unfamiliar with TCP segments, you can refer to this article here on Transmission Control Protocol (TCP):
- There is another question: normaly, how many bytes is the whole IP packet linearly? and within it, how many bytes usually is the header? I don't understand the first picture in the text? Should it be linear?(2 votes)
- I'm not sure what you mean with linearly.
The header of an IPv4 packet is between 20 and 24 bytes long and the header of an IPv6 packet is 40 bytes.
The maximum size of an IP packet (total) is 2^16 - 1 bytes.(2 votes)
- Regarding the servers, I know that is has little to do with this course in particular, but is that all the data, for example, text and videos in Khan Academy website is stored in a specific server hard disk in Google's data center? In this way, all the data from all the websites available in Google is stored in Google servers?(2 votes)
- Does this work with all electronics like computers Ipads phones .ect(2 votes)
- This is essentially how any device with internet capabilities works.(1 vote)
- Paragraph 2 & 3 seem very similar. Are they saying the same thing or am I missing something?(2 votes)
- No I don't think you're missing anything, it looks like the same sentence formulated differently.
You could mention it in the Tips & Thanks section of the article. I think Pamela might spot it easier that way.(0 votes)