 Now let's look at an example of an actual packet and I'll use the internet protocol for this example So we look at the structure of an IP datagram So the internet protocol refers to as a datagram instead of a packet So the top two lines here show an example IP datagram that I've recorded in the past So this sequence of if you count them 160 bits I've actually had to wrap the line and I could not fit them all on the one line But what is a packet? It's just a sequence of zeros and ones But what's important is that those zeros and ones have some meaning and A standard normally defines What different bits in that packet mean so first we From what I present here. We can read left to right so the first First bits if I read out a zero one zero zero zero one zero one and the last Two bits are one zero. That's on the second line on the right hand side This is in fact the header of an IP datagram It's not the entire datagram that the data I have not shown So it's just the header and there are 160 bits or 20 bytes What those bits mean What is this control information contained in the IP datagram header? Well, we need to look in the standard to see how the IP datagram header is structured if you look up the The standard for the internet protocol RFC 791 it defines which bits belong to which fields So a header has fields and those fields have values I've highlighted those different fields in the IP header in different colors here So the first field is the first four bits zero one zero zero That is the version of the protocol used in this case The next four bits the green zero one zero one indicate the header length and Then we have further fields as we go through a six-bit field in blue a two-bit field and so on and The last two fields are each 32 bits in length There's the source address and the destination address identifying who created this IP datagram and who is it destined to The standard defines the meaning of how to interpret those field values. So the field values in binary. What do they mean? Some of us some of them are obvious some some are not so obvious For example, the version in binary zero one zero zero in decimal four meaning we're using IP version four The header length zero one zero one in decimal five What does that mean? It doesn't mean the header is five Bites in length. It doesn't mean the header is five bits in length If you look at the standard actually means that the header is five times four bytes in length That is the header field. Sorry the header length field counts in groups of four bytes or 32 bits So a value of five means the header is 20 bytes in length The reason we include the header length in an IP datagram is because you can actually include optional header fields Making the the header larger than 20 bytes The source and destination address 32 bit values. Of course, we can map them to some human-friendly daughter decimal notation 10 10 1 0 1 dot 6 5 for my source address and destination address of course Presenting a packet header or an entire packet in binary is not very convenient for for us humans to look at and and to write down So often we structure it in a different way what I've done here is taken those 160 bits and written them in Five rows each containing 32 bits So in fact from the top we see the first first byte the second byte is eight zeros and Then on the second row we have the fifth byte all the way through to the 20th byte at the end Just a rearrangement of those of that packet header Why don't you that? Because that's the common way to view the IP datagram header Looking at it from the perspective of rows as opposed to a single line or a single row of bits and we get From there to a common diagram that shows up the structure of an IP datagram It shows a row by row each row containing four bytes or 32 bits and By default there are five rows in the IP datagram header 20 bytes the first field in the IP datagram header is the version field and That is contained in the first four bits The next four bits the header length H length on this diagram If we count the bits at zero then the version is bit zero one two three the header length bit four five six seven the 31st bit is The end of the total length field and then the next bit is the start of the identification field So we read road row by row Left to right so this shows the diagram of an IP datagram Including the header the default size of 20 bytes It also shows that in an IP datagram header. We can have optional fields and To make sure that the header is a multiple of four bytes or 32 bits We may need some padding depending upon the length of those options and Then the data follows Later we'll look at how long the data can be the data in this diagram is the payload of this packet So even though packets are just a sequence of bits when we want to draw them or describe them We often for convenience draw them row by row There's a typo there for convenience headers and trailer fields often drawn row by row Sometimes we even draw them in a in a simpler form We just draw the header and the data or the payload as in this case So instead of drawing all the individual header fields as row by row We draw a single row indicating the IP header followed by the data or the payload and we may List those header fields underneath the header. So just different ways to to communicate the the structure of a packet This gives the actual values all the header fields and their values for the example IP datagram header that I showed So the the version IP version for the header length 20 bytes Even though the value was five because it's interpreted as five times four bytes and the other fields All the way through this through to the source and destination address One thing to note there is there's in the middle. There's some flags used Recall a flag usually is a single bit value when it's zero it means some feature is off or not set When it's one that fit a feature is on or true or set So in this example IP datagram There was a flag that says the don't fragment Option is set. You should not fragment this datagram And there's a another flag a single bit values saying that there are no more fragments that if the more fragments Feature or option is not set because the flag value is zero next. We'll look at How do we determine what the a good size of a packet is?