02.02.2018 Views

Practical_modern_SCADA_protocols_-_dnp3,_60870-5_and_Related_Systems

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

338 <strong>Practical</strong> Modern <strong>SCADA</strong> Protocols: DNP3, <strong>60870</strong>.5 <strong>and</strong> <strong>Related</strong> <strong>Systems</strong><br />

The Ver (version) field is 4 bits long <strong>and</strong> indicates the version of the IP protocol in use.<br />

For IPv4 it is 4.<br />

This is followed by the 4-bit IHL (Internet header length) field that indicates the length<br />

of the IP Header in 32-bit ‘long words’. This is necessary since the IP header can contain<br />

options <strong>and</strong> therefore does not have a fixed length.<br />

The 8-bit type of service (ToS) field informs the network about the quality of service<br />

required for this datagram. The ToS field is composed of a 3-bit precedence field (which<br />

is often ignored) <strong>and</strong> an unused (LSB) bit that must be 0.<br />

The remaining 4 bits may only be turned on (set =1) one at a time, <strong>and</strong> are allocated<br />

as follows:<br />

Bit 3:<br />

Bit 4:<br />

Bit 5:<br />

Bit 6:<br />

Minimize delay<br />

Maximize throughput<br />

Maximize reliability<br />

Minimize monetary cost<br />

Total Length (16 bits) is the length of the entire datagram, measured in bytes. Using this<br />

field <strong>and</strong> the IHL length, it can be determined where the data starts <strong>and</strong> ends. This field<br />

allows the length of a datagram to be up to 2 16 = 65 536 bytes, although such long<br />

datagrams are impractical. All hosts must at least be prepared to accept datagrams of up to<br />

576 octets.<br />

The 16-bit identifier uniquely identifies each datagram sent by a host. It is normally<br />

incremented by one for each successive datagram sent. In the case of fragmentation, it is<br />

appended to all fragments of the same datagram for the sake of reconstructing the<br />

datagram at the receiving end. It can be compared to the ‘tracking’ number of an item<br />

delivered by registered mail or UPS.<br />

The 3-bit flag field contains 2 flags, used in the fragmentation process, viz. DF <strong>and</strong> MF.<br />

The DF (don’t fragment) flag is set (=1) by the higher-level protocol (e.g. TCP) if IP is<br />

NOT allowed to fragment a datagram. If such a situation occurs, IP will not fragment<br />

<strong>and</strong> forward the datagram, but simply return an appropriate ICMP error message to the<br />

sending host. If fragmentation does occur, MF=1 will indicate that there are more fragments<br />

to follow, whilst MF=0 indicates that it is the last fragment to be sent.<br />

The 13-bit fragment offset field indicates where in the original datagram a particular<br />

fragment belongs i.e. how far the beginning of the fragment is removed from the end of<br />

the header. The first fragment has offset zero. The fragment offset is measured in units of<br />

8 bytes (64 bits); i.e. the transmitted offset is equal to the actual offset divided by eight.<br />

The TTL (time to live) field ensures that undeliverable datagrams are eventually<br />

discarded. Every router that processes a datagram must decrease the TTL by one <strong>and</strong> if<br />

this field contains the value zero, then the datagram must be destroyed. Typically a<br />

datagram can be delivered anywhere in the world by traversing fewer than 15 routers.<br />

The 8-bit protocol field indicates the next (higher) level protocol header present in the<br />

data portion of the IP datagram, in other words the protocol that resides above IP in the<br />

protocol stack <strong>and</strong> which has passed the datagram down to IP. Typical values are 1 for<br />

ICMP, 6 for TCP <strong>and</strong> 17 for UDP. A more detailed listing is contained in RFC 1700.<br />

The checksum is a 16-bit mathematical checksum on the header only. Since some header<br />

fields change all the time (e.g. TTL), this checksum is recomputed <strong>and</strong> verified at each<br />

point that the IP header is processed. It is not necessary to cover the data portion of the<br />

datagram, as the <strong>protocols</strong> making use of IP, such as ICMP, IGMP, UDP <strong>and</strong> TCP, all have<br />

a checksum in their headers to cover their own header <strong>and</strong> data.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!