# IP header
## Obiettivi di apprendimento

* get a feeling for the IP header
* get a better understanding of how the protocol works
* understand which header fields are changed while routing

## Trascrizione

Like the Ethernet, the Internet protocol has IP header and Data parts and is a bit stream - a sequence of 1s and 0s.
Display of the bit-stream: Every 32 bits which are called 32-bit-word or register in a 32-bit architecture. 1) Version Represents the version of Internet protocol. 4bits=24=16 possible values. The version can be 4 or 6 but may be another one. 2) IHL (internet header length) Internet protocol allows this header to have flexible size but it cannot be more than 15 words=15*32=15*4=60 bytes – maximum length 3) DSCP (differentiated services code point) Formally known as the representation of the type of a project. But it was not used too frequently so internet service providers come up with idea of putting priority of IP packages in this field 4) ECN (explicit congestion notification) Is rarely used. But what it really does is if the part of the wire has too much traffic on it at the moment of time this can be put there in this field so then routers might be able to search for other routs to the destination network.
5) Total length -16 bit field -represents the binary length of the package in bytes - up to 65536 bytes are allowed - might not fit into Ethernet frame So when you want to put IP packages inside the Ethernet frames and the IP packages are bigger than the Ethernet frames you might have problems. When you do routing you don’t know what kind of link layer protocols you will use. So at the beginning you use DSL or ISDN and your package might fit link layer protocol. But at some network you can use Ethernet protocol with really small frame size so package doesn’t fit anymore. Internet protocol can solve this problem using fragmentation. 6) Identification Is used for uniquely identifying fragments of original IP datagram.
7) Flags You specify here will can your fragment be fragmented or not.
8) Fragment Offset When you decide that package can be fragmented happens that packages that are being fragmented become an offset. When you have several fragmented offsets what you can do is you can reassemble those packages. 9) Time to live Is a number usually 64 and every time a router forwards the package to the next router this number is decreased by 1. Why do we need it? Let’s assume that router is misconfigured and then IP packages are always forwarded inside a circle but never arrive at the final destination. This would mean that they blow up the network really fast.
10) Protocol Used to identify upper level protocol. 11) Header checksum In the Ethernet you have a checksum for the entire package but here only the header is checked. The Ethernet has already checked if the data is correct but we don’t want any false information inside IP package Header. Because then the package will be routed on the wrong route and this won’t be good.
12) Source IP Address 13) Destination IP Address 14) Options (if IHL > 5) --Jane Kruch (discuss • contribs) 23:12, 2 November 2013 (UTC)

## Ulteriori letture

* Internet Protocol v4
* http://tools.ietf.org/html/rfc791

## Discussioni

* Ethernet
** Communication over a shared Medium
** Ethernet header
** Minimum package length vs maximum cable length
** Collision detection
** Summary, further reading, homework
* Internet Protocol
** Motivation for IP
** Classful IPv4 networks
** IP forwarding algorithm
** IP header
** Summary, further reading, homework
* Transmission Control Protocol
** End to end principle and connection oriented communication
** Three way handshake
** Port numbers
** Sliding window and flow control
** Summary, further reading, homework
* Domain Name System
** Tree structure
** Terminology
** Zones
** Review some facts about DNS
** Delegating DNS queries
** DNS address resolution
** Summary, further reading, homework
* Internet vs World Wide Web
** Summary of the internet architecture
** Motivation and requirements for the World Wide Web
** Design principles of the web
** Uniform Resource Identifier
** Summary, further reading, homework
* Hypertext Transfer Protocol
** Making HTTP requests
** A simple web client
** A simple web server
** HTTP header
** Content negotiation
** Summary, further reading, homework
* Web content
** Problem setting for web content formats
** Working with XML
** HTML for web document structures
** Layout elements in HTML
** Motivating separation of content and layout
** Cascading Style Sheets
** Media content
** Metadata
** Summary, further reading, homework
* Dynamic Web Content
** Basics of server side web programming
** Forms and HTTP post request
** Handling a post request in a Java Servlet
** Client side JavaScript
** Ajax and the XMLHttpRequest class
** Summary, further reading, homework