12,401,984 members (31,560 online)
Rate this:
See more:
Question:
The following is a dump of a TCP header in hexadecimal format.

05320017 00000001 00000000 500207FF 00000000

a. What is the source port number?
b. What is the destination port number?
c. What is the sequence number?
d. What is the acknowledgment number?
e. What is the length of header?
f. What is the type of segment?
g. What is the window size?
Posted 8-Mar-10 4:09am
Updated 14-Jun-10 0:20am
Moak11.5K
v2

Rate this:

## Solution 1

All the information you need is found via Google. Here[^] is just one document showing the various fields.
Rate this:

## Solution 2

TCP header itself is of 10 feilds as below and size may vary between 20 to 60bytes

1.Source port - 2 bytes
2.destination port - 2 bytes
3.SEQ NUM-4 bytes
4.ACK NUM- 4 bytes
5.HLEN-1 word
6.RESERVED-6bits
7.CONTROL-6bits
8.WINDOW SIZE-2 bytes
9.CHECKSUM-2 bytes
10.URGENT POINTERS-2bytes

here's example problem from book Forouzan

TCP header( in hex)=05320017 00000001 000000000 500207FF 00000000
since each hex = 4 bits , we need to first split the above hex as such
05 32 00 17 00 00 00 01 00 00 00 00 50 02 07 FF 00 00 00 00

source port is 2 bytes take 05 32 = 1330
next 2 bytes as destination address 00 17 == 23 (default TCP port)
next 4 bytes as sequence number 00 00 00 01 ==1
next 4 bytes as ack 00 00 00 00 == 0
next 4 bits as HLEN 5 ==5 -- this indicates number of sets of 4 bytes which makes the header lenght = 20bytes..
next 6 bits are reserved i.e.0 =0000and 2 bits from hex 0
next 6 bits are control bits = remaining 2 bits from hex 0 and 4 bits of 2
next 2 bytes indicate the window length 07 FF == 2047 bytes
Checksum 2 bytes 00 00 = 0
Urgent pointer 2bytes 00 00 =0
Rate this:

## Solution 3

Here[^] is the structure of the TCP segment header. Decipher it yourself
Rate this:

## Solution 5

Source port = 1330 = 0x0532
Dest port = 0x0017
seq num = 0x00000001
ack = 0x00000000
length = 0x50
type = 0x02 look up the flag bits to see what 0x02 is
size = 0x07ff
CHill(Hawkeye)60 17-May-14 14:41pm

4 years ago this might have helped. Although it would seem the other solutions were enough

Yeah, OP posted Solution 2 less than 30 minutes after posting the question...
I know my comment has nothing to do with this solution, I just thought I would point it out.

Top Experts
Last 24hrsThis month
 OriginalGriff 250 Richard Deeming 223 Karthik Bangalore 180 ppolymorphe 145 F-ES Sitecore 135
 OriginalGriff 7,073 ppolymorphe 3,030 Karthik Bangalore 2,917 F-ES Sitecore 2,187 Richard MacCutchan 2,125