Net

See actual homework as well as report

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Individual Project

Deliverable Length: 4 – 5 pages

The OSI Layer 3 (Network Layer) is one of the layers that perform packet segmentation. The

OSI Layer 3 is roughly equivalent to the Internet Layer of the TCP/IP model and the Layer 4

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

(Transport Layer) of the OSI model is roughly equivalent to the Host-to-Host layer of the

TCP/IP model. The above two layers perform network segmentation. Based on the above

information, answer the following questions.

(a) Describe in detail how packets are segmented by the Host-to-host layer (Transport Layer)

Internet Layer of the TCP/IP model.

(b) Do all packets arrive at their destination in the order in which they were segmented and

transmitted? Why or why not?

(c) Describe how segmented packets are re-arranged or reassembled at the packets ’

destination to ensure that received segmented packets match the order in which they were

segmented and transmitted.

(d) How are errors handled during transmission of segmented packets?

(e) What’s the difference between a TCP segment and a TCP packet?

Please answer the following questions and requirements to write your paper of 4–5 pages.

As you answer each question, you must provide support or evidence that will enhance and empirically prove your answers. Academic IT articles or real-life IT findings that are not found in journals or other academic sources must be used in supporting your answers. Please use APA style for all cited sources, including your reference page.

Please include the following elements in your paper:

A title page

A report that includes the following:

An introduction to the contents of the report

Detailed explanations about the items listed regarding network segmentation, error handling, TCP

segments and TCP packets.

Please cite your references in APA format.

Introduction:

Transport Layer:

Transport Layer forms the base of the internet which is included in both OSI model as well as TCP/IP model. Its functionality differs in both the models providing appropriate services like flow control, connection-oriented data stream support and multiplexing. .

The transport layer provides endwise communication services for applications within a layered approach of network components.

Segmentation is the process of dividing the data stream or the contents of message into packets.

Whenever a command is issued in a TCP/IP application layer protocol, a sequence of events gets initiated. The message or command first passes through the stack TCP/IP protocol stack in a personal system. It then passes across the network media and protocols on a distant or remote system. At every layer the protocols on the sending host adds information to the actual data and also interacts with the peers on the receiving host. 

Security using Data Encapsulation:

Information is transferred across a network in the form of packets. Every packet consists of a header with the address of sending and receiving systems and a body with data to be transferred. The process in which a protocol on the sending host adds data to the packet header is named data encapsulation. Every layer has a different term for the altered packet, like a packet on a Transport layer is termed as TCP segment, IP diagram in Internet layer, Frame in data link layer and physical Network layer.


Protocols in Transport Layer:

The most commonly used transport protocol is the Transmission Control Protocol (TCP). It is used for connection-oriented transmission(s), whereas the other connectionless i.e. User

Datagram Protocol (UDP) is used for simpler messaging transmission applications.

TCP is the more complex protocol, due to its design which incorporates reliable transmission and data streaming services.

Other protocol examples in this group are the Datagram Congestion Control Protocol (DCCP) and the Stream Control Transmission Protocol (SCTP).


Packet – Packaging the Transport Layer:

With Transport layer segment or datagram the network can deliver data/information to the destination host.

The IPv4 encapsulation remains in place from the time the packet leaves the Network layer of the originating host until it arrives at the Network layer of the destination host.

The process of encapsulating data by layer enables the services at the different layers to develop and scale without affecting other layers.

This means that transport layer segments can be readily packaged by existing Network layer protocols, such as IPv4 and IPv6 or by any new protocol that might be developed in the future.

Routers can implement these different Network layer protocols to operate concurrently over a network to and from the same or different hosts.

The routing performed by these intermediary devices only considers the contents of the packet header that encapsulates the segment. In all cases, the data portion of the packet – that is, the encapsulated Transport layer PDU – remains unchanged during the Network layer processes


Packet Header:

As shown in the figure, an IPv4 protocol defines many different fields in the packet header. These fields contain binary values that the IPv4 services reference as they forward packets across the network.

This course will consider these 6 key fields:

1. IP Source Address

2. IP Destination Address

3. Time-to-Live (TTL)

4. Type-of-Service (ToS)

5. Protocol

6. Fragment Offset


IP Destination Address:

The IP Destination Address field contains a 32-bit binary value that represents the packet destination Network layer host address.


IP Source Address:

The IP Source Address field contains a 32-bit binary value that represents the packet source Network layer host address.

(b) Do all packets arrive at their destination in the order in which they were segmented and transmitted? Why or why not?

There is no specific transmission order. Typically transmission of packets happens in a asynchronous manner. So it is necessary to know the start bit and end bit of each packet.

When we look at the case with RS232 characters it was accompanied with a start and an end bit. The process of identifying start and end of a packet is named as the framing problem.

There are many reasons why data in networks is transmitted in packets, which are sequences of data blocks called octets (i.e. bytes).

Some common reasons are:

1. Cheaper to deal with loss or corruption of small packets than with long full messages;

2. Easier to share communication channels between concurrent communicating entities since there are no long messages for whose transmission all have to wait;

3. Usually less total transfer time in a store-and-forward multi-hop network modes.

One possible way to represent a packet is by starting it with a special character, say SOH = 0x01, and ending it with a special character, say EOT=0x04. Then one can recognize a packet by looking for these characters. Of course, we need to make sure that SOH and EOT appear only at the beginning and end of packets. This is done with byte stuffing: that is replacing in the data each occurrence of SOH, EOT, and ESC=0x1B, with ESC SOH, ESC EOT, and ESC ESC respectively (in bit oriented transmission like in HDLC one encounters bit stuffing, where one uses the pattern 01111110 to start and end a packet. Of course then in the data one has to prevent the occurrence of 6 consecutive 1s. This is done always inserting a 0 after five data 1s.).

(c) Describe how segmented packets are re-arranged or reassembled at the packets’ destination to ensure that received segmented packets match the order in which they were segmented and transmitted.


Packet Reassembling (or packet re-arrangement)

Network protocols often need to transport large chunks of data, which are complete in themselves, e.g. when transferring a file. The underlying protocol might not be able to handle that chunk size (e.g. limitation of the network packet size), or is stream-based like TCP, which doesn’t know data chunks at all.

Reassembling might take place at several protocol layers, so it’s possible that multiple tabs in the “Packet Bytes” pane appear.

You will find the reassembled data in the last packet of the chunk.

In that case the network protocol has to handle the chunk boundaries itself and (if required) spread the data over multiple packets. It obviously also needs a mechanism to determine the chunk boundaries on the receiving side.

Wireshark calls this mechanism reassembling, although a specific protocol specification might use a different term for this (e.g. desegmentation, defragmentation, …).


How Wireshark works:

For some of the network protocols Wireshark knows of, a mechanism is implemented to find, decode and display these chunks of data. Wireshark will try to find the corresponding packets of this chunk, and will show the combined data as additional pages in the “Packet Bytes” pane.

Figure: The “Packet Bytes” pane with a reassembled tab

An example: In a HTTP GET response, the requested data (e.g. an HTML page) is returned. Wireshark will show the hex dump of the data in a new tab “Uncompressed entity body” in the “Packet Bytes” pane.

Reassembling is enabled in the preferences by default. The defaults were changed from disabled to enabled in September 2005. If you created your preference settings before this date, you might look if reassembling is actually enabled, as it can be extremely helpful while analyzing network packets.

The enabling or disabling of the reassemble settings of a protocol typically requires two things:

1. the lower level protocol (e.g., TCP) must support reassembly. Often this reassembly can be enabled or disabled via the protocol preferences.

2. the higher level protocol (e.g., HTTP) must use the reassembly mechanism to reassemble fragmented protocol data. This too

(d) How are errors handled during transmission of segmented packets?


Error Handling during packet transmission
:

Error detection is a form of error control [other forms of error control, for error recovery, are Forward Error Recovery and Automatic Repeat Request [ARQ]. ARQ involves Positive Acknowledgement,Retransmission after TimeoutNegative Acknowledgement and Retransmission. We will talk more about ARQ when we discuss data link level protocols.]. In general when a frame is sent, it may be lost in transit or it may be delivered corrupted (one hopes it gets there unchanged). The loss-in-transit of a frame is recognised by the sender by setting a time-out on the expected reception of an acknowledgement from the receiver. 
Here we describe three methods that allow the receiver to detect errors, that is, to know with some probability that it has received what the sender sent.

· Parity Bits: Suppose we send the following sequence of bits: 00101100 then if we send the sequence using even parity we will append one 1 and if are using odd parity we will append one 0. At the receiving end it will be easy to check if there has been a recognizable error. Instead of providing a one bit parity check for a whole data sequence we may provide an octet as parity check by dividing the data sequence into octets and then providing parity for each bit position. Parity checks are easily done but with very limited power to detect errors. Here we show the even parity octet for the following four octets

00011100
11011110
11100110
10101001
=

======

10001101 Even parity octet

We will be able to detect any single bit error in this block [because one of the parity bits will be inconsistent with the corresponding column]. 
If we add a parity bit to each octet, the resulting block

000111001
110111100
111001101
101010010
=========
100011010

will be able to detect and correct a single bit error [if you change any single bit both the horizontal and vertical parity bits become inconsistent, thus identifying both the row and the column of the error bit].

· Checksum: Now instead of interpreting the data as a sequence of octets, we can treat it as a sequence of 16 bit integers and then add to the sequence the sum of all these integers (summing in also the carry bits). For example

|48|65| “He”

|6C|6C| “ll”

|6F|20| “o ”

|77|6F| “wo”

|72|6C| “rl”

|64|2E| “d.”

======

|71|FC| Checksum

Alternatively the checksum can be computed by adding each individual byte and using the carry as an additional addend. Checksums are easy to compute and have a fairly good capacity to detect errors. Unfortunately they do not detect simple forms of errors. For example, suppose that errors reverse the value of the second bit of each word being transmitted. If these words had the same number of 1s and 0s as second bits then the error will not be detected.

Here is a routine to compute the checksum of an array of short unsigned integers:

unsigned short checksum(unsigned short *buffer, int count)
{
unsigned long int csum = 0;
while (count–) {
csum += *buffer++;
if (csum & 0xFFFF0000){ // There is a carry
csum &= 0x0000FFFF;
csum++;
}
}
return (csum & 0xFFFF); /* The checksum computed in the
internet is really !(csum & 0xFFFF)
that is the 1-complement, so that at
receiving end the total sum, including
received checksum, is zero. */
}

· Cyclic Redundancy Checks (CRC): The best method for detecting transmission errors is to use Cyclic Redundancy Checks, or CRC. CRC is founded on the idea that each word can be interpreted as a polynomial. For example the word |48|65| has the binary digits 100 1000 0110 0101 and can be interpreted as the polynomial

X**14 + X**11 + X**6 + X**5 + X**2 + 1

Then an irreducible polynomial P (it is for polynomials the same as a prime for numbers) is used to compute the modulo of the data polynomial. This modulo is taken as the CRC and appended to the data. The nice thing is that the modulo can be computed using simple circuits: XOR gates and shift registers initially containing 0. Here is an example of circuit for computing the CRC using as P the polynomial

X**16 + X**12 + X**5 + 1

When the all the data has been inputted the shift registers will contain the CRC. 
 

|In
v X**16 X**12 X**5 1
X——————>+—————————>+———————-+
^ | | |
| +–+–+–+–+ v +–+–+–+–+–+–+–+ v +–+–+–+–+–+ v
+<--| | | | |<--X<--| | | | | | | |<--X<--| | | | | |<--+ | +--+--+--+--+ +--+--+--+--+--+--+--+ +--+--+--+--+--+ vout

To understand this structure, imagine that we are transmitting a single 1. Then, since it will be appended to the remainder, it is as if the 1 was multiplied by X**16, the degree of P. That is we obtain

X**16 1
| |
v v
10000000000000000
the remainder of this when dividing by P is
X**12 X**5 1
| | |
v v v
0001000000100001

which is just P eliminating its leading term. The Xor gates are positioned in the places where we have the 1s. When the message (data plus remainder) is received, the data will cause that same remainder to be computed in the receiver’s register. When the original remainder is received, the two remainders will cancel each other leaving 0s in the registers.

Here is how things work out for our original data 100100001100101

Arriving |
Bits | Content of registers
=================================
1 0000 0000000 00000
0 0001 0000001 00001
0 0010 0000010 00010
1 0100 0000100 00100
0 1001 0001001 01001
———————————
0 0011 0010011 10011
0 0110 0100111 00110
0 1100 1001110 01100
1 1000 0011101 11001
1 0000 0111011 10010
———————————
0 0001 1110110 00101
0 0011 1101100 01010
1 0111 1011000 10100
0 1110 0110000 01001
1 1101 1100001 10011
———————————
1011 1000011 00110

Thus the message (data plus remainder) is 100100001100101 1011100001100110

More formally, if P(x) is the irreducible polynomial and M(x) is the message we are sending, the circuit operates as if we were sending the code C(x) = (x**r)*M(x) + R(x), where r is the degree of P(x) and R(x) is the remainder of the divisions of (x**r)*M(x) by P(x). Since the dividend is equal to the divisor*quotient + remainder, C(x) is just P(x)*quotient [since R(x) + R(x) is just 0 in binary arithmetic, and P(x) is the divisor). Thus the receiver will receive just P(x)*quotient and dividing it by P(x) will have a zero remainder. Of course if the code is corrupted during transmission the remainder at the receiver will not be 0. In fact, if the error is E(x), the remainder will be E(x)/P(x).

If you use a CRC polynomial of degree r, then that use will allow us to detect errors in the message of up to r bits. If there are more than r bit errors, then there is no guaranty that we will detect the error, but it is likely that we do so (the probability of undeteced error is 1/2^r).

You can find additional information about CRC and even an animation of the algorithm 

here

.

Though Cyclic Redundancy Checks may be greatly superior to checksums, checksums may be preferred when computation speed is of the essence. For example in the IP protocol (that we study later) they use checksums [and to do them faster the sender computes the 1-complement checksum, the receiver computes the checksum and then adds it to the sender’s checksum to obtain 0 – thus saving on the time it would take if we did checksums at both sender and receiver and then compared]. Ethernet uses 32-bit CRC.


Forward Error Recovery:

By using redundancy (i.e. transmitting in addition to the data a number of extra bits], it is possible to not only detect but also recover from certain kinds of errors without need of retransmission. Forward Error Recovery used to be called just Error Correction. Here are some basic ideas.

Suppose I have two bit vectors, for instance 0110101 and 0100111, their Hamming Distance is the number of bit where they differ (in our case the Hamming distance is 2). Then, if we use a set S of bit vectors such that the minimal Hamming distance between two elements of S is d, then

1. we will be able to detect up to d-1 bit errors, and

2. we will be able to correct up (d-1)/2 bit errors

when transmitting elements of S. 
The argument for 1. is easy: by definition of distance we know that if we change up to d-1 bits in an element of S we do not get an element of S, thus the result of the change will not be in S. 
The argument for 2. is a bit subtler (if follows what is called The Maximum Likelihood Principle): we claim that we can correct up to e errors where 2e+1 <= d. In fact if we have e errors in an element of S we will remain at distance at least e+1 from any other element of S, so it is rational to identify the erroneous vector with the closest element in S, the one at distance e.

Here is an example of 1 bit error correcting code (minimum distance = 3): We are given the following 4-bit vectors.

0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

We represent them with the 7-bit vectors (the original 4 plus 3)

0000 000
0001 101
0010 111
0011 010
0100 011
0101 110
0110 100
0111 001
1000 110
1001 011
1010 001
1011 100
1100 101
1101 000
1110 010
1111 111

where the three additional bits are parity bits obtained considering, in order,

bits 1 3 4 to compute the 5thbit
bits 1 2 3 to compute the 6thbit
bits 2 3 4 to compute the 7thbit
that is
(bit1 + bit3 + bit4 + bit5 = 0 modulo 2)
(bit1 + bit2 + bit3 + bit6 = 0 modulo 2)
( bit2 + bit3 + bit4 + bit7 = 0 modulo 2)

(e) What’s the difference between a TCP segment and a TCP packet?

· A segment is a subset of a larger network.

· A packet is one unit of routable data

· The data packet is larger than the maximum transmission unit supported by the network

· The network is unreliable and it’s desirable to divide the information into smaller segments to maximize the probability that each one of them can be delivered correctly to the destination.

Still stressed with your coursework?
Get quality coursework help from an expert!