02.02.2018 Views

Practical_modern_SCADA_protocols_-_dnp3,_60870-5_and_Related_Systems

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Ethernet <strong>and</strong> TCP/IP networks 347<br />

The source <strong>and</strong> destination ports (16 bits each) identify the host processes at each side<br />

of the connection. Examples are post office protocol (POP3) at port 110 <strong>and</strong> simple mail<br />

transfer protocol (SMTP) at port 25. Whereas a destination host is identified by its<br />

IP address, the process on that host is identified by its port number. A combination of port<br />

number <strong>and</strong> IP address is called a socket.<br />

The sequence number (32 bits) ensures the sequentiality of the data stream. TCP by<br />

implication associates a 32-bit number with every byte it transmits. The sequence number<br />

is the number of the first byte in every segment (or ‘chunk’) of data sent by TCP. If the<br />

SYN flag is set, however, it indicates that the sender wants to establish a connection <strong>and</strong><br />

the number in the sequence number field becomes the initial sequence number or ISN.<br />

The receiver acknowledges this, <strong>and</strong> the sender then labels the first byte of the transmitted<br />

data with a sequence number of ISN+1. The ISN is a pseudo-r<strong>and</strong>om number with values<br />

between 0 <strong>and</strong> 232.<br />

The acknowledgment number (32 bits) is used to verify correct receipt of the transmitted<br />

data. The receiver checks the incoming data <strong>and</strong> if the verification is positive,<br />

acknowledges it by placing the number of the next byte expected in the acknowledgment<br />

number field <strong>and</strong> setting the ACK flag. The sender, when transmitting, sets a timer <strong>and</strong> if<br />

acknowledgment is not received within a specific time, an error is assumed <strong>and</strong> the data is<br />

retransmitted.<br />

Data offset (4 bits) is the number of 32-bit words in the TCP header. This indicates<br />

where the data begins. It is necessary since the header can contain options <strong>and</strong> thus does<br />

not have a fixed length.<br />

Six flags control the connection <strong>and</strong> data transfer. They are:<br />

• URG: Urgent pointer field significant<br />

• ACK: Acknowledgment field significant<br />

• PSH: Push function<br />

• RST: Reset the connection<br />

• SYN: Synchronize sequence numbers<br />

• FIN: No more data from sender<br />

The window field (16 bits) provides flow control. Whenever a host sends an acknowledgment<br />

to the other party in the bi-directional communication, it also sends a window<br />

advertisement by placing a number in the window field. The window size indicates the<br />

number of bytes, starting with the one in the acknowledgment field, that the host is able<br />

to accept.<br />

The checksum field (16 bits) is used for error control.<br />

The urgent pointer field (16 bits) is used in conjunction with the URG flag <strong>and</strong> allows<br />

for the insertion of a block of ‘urgent’ data in the beginning of a particular segment.<br />

The pointer points to the first byte of the non-urgent data following the urgent data.<br />

UDP<br />

User datagram protocol (UDP) is a ‘connectionless’ protocol <strong>and</strong> does not require a<br />

connection to be established between two machines prior to data transmission. It is therefore<br />

said to be ‘unreliable’ – the word ‘unreliable’ is used here as opposed to ‘reliable’ in<br />

the case of TCP <strong>and</strong> should not be interpreted in its everyday context.

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

Saved successfully!

Ooh no, something went wrong!