- Posts: 227
- Thank you received: 0
TCP Question
16 years 1 month ago #28127
by apit
TCP Question was created by apit
From firewall.cx note, i found that TCP and UDP source & destination address is 16 bits..Actually what is 16 bits?
From my understanding, if hostA(client) transfer data to hostB(webserver) , they will using random port number at hostA.. let say port 1030 and hostB using port 80..
1030 decimal = 10000000110 binary
80 = 01010000 binary
From my understanding, if hostA(client) transfer data to hostB(webserver) , they will using random port number at hostA.. let say port 1030 and hostB using port 80..
1030 decimal = 10000000110 binary
80 = 01010000 binary
16 years 1 month ago #28128
by Chojin
CCNA / CCNP / CCNA - Security / CCIP / Prince2 / Checkpoint CCSA
Replied by Chojin on topic Re: TCP Question
16 bits = 65535.
That is the ammount of ports available on a computer.
As you know TCP and UDP make use of ports to communicatie (talk and listen).
The client will indeed use a free port to send information to the server. The server in this case is a HTTP server which is listening on port 80 (defined port)... so the client will send information from a source port (1025-65535 these are the undefined ports) to the destination port the server is listening on (80)
Now the webserver receives the information by IP address and recognizes the port 80 because the server has enabled data for port 80.
It will read the data (probably a HTTP requesT) and send the requested data back to the source port of the client, because in the mean time the client is listening on the port where it sends out the data (1030 in your example).. this way the computers can set up a session.
Hope this helps a bit
That is the ammount of ports available on a computer.
As you know TCP and UDP make use of ports to communicatie (talk and listen).
The client will indeed use a free port to send information to the server. The server in this case is a HTTP server which is listening on port 80 (defined port)... so the client will send information from a source port (1025-65535 these are the undefined ports) to the destination port the server is listening on (80)
Now the webserver receives the information by IP address and recognizes the port 80 because the server has enabled data for port 80.
It will read the data (probably a HTTP requesT) and send the requested data back to the source port of the client, because in the mean time the client is listening on the port where it sends out the data (1030 in your example).. this way the computers can set up a session.
Hope this helps a bit
CCNA / CCNP / CCNA - Security / CCIP / Prince2 / Checkpoint CCSA
16 years 1 month ago #28141
by S0lo
Studying CCNP...
Ammar Muqaddas
Forum Moderator
www.firewall.cx
Replied by S0lo on topic Re: TCP Question
Well explained Chojin
I see what your getting at by this one. 10000000110 (1030) is 11 bits and 1010000 (80) is 7 bits. So why do they say 16bits ? ha?
10000000110 is saved in the packet as 0000010000000110
1010000 is saved in the packet as 0000000001010000
Trailing zeros are added to the left so that the total is 16 bits. Does that make sense?
1030 decimal = 10000000110 binary
80 = 01010000 binary
I see what your getting at by this one. 10000000110 (1030) is 11 bits and 1010000 (80) is 7 bits. So why do they say 16bits ? ha?
10000000110 is saved in the packet as 0000010000000110
1010000 is saved in the packet as 0000000001010000
Trailing zeros are added to the left so that the total is 16 bits. Does that make sense?
Studying CCNP...
Ammar Muqaddas
Forum Moderator
www.firewall.cx
16 years 1 month ago #28145
by Chojin
Thanks
Also, nice remark about the trailing zero's... makes it even a bit more clear I guess.
CCNA / CCNP / CCNA - Security / CCIP / Prince2 / Checkpoint CCSA
Replied by Chojin on topic Re: TCP Question
Well explained Chojin
Thanks
Also, nice remark about the trailing zero's... makes it even a bit more clear I guess.
CCNA / CCNP / CCNA - Security / CCIP / Prince2 / Checkpoint CCSA
16 years 1 month ago #28151
by apit
Replied by apit on topic Re: TCP Question
thanks chojin & solo..
one more question..Port numbers is devide into 3 which is :
1. Well Known Port Numbers (0 through 1023)
2. Registered Port Numbers (1024 through 49151)
3. Dynamic Port Numbers (49152 through 65535)
Client will using registered port numbers & dynamic port numbers is it?
Why server is using fix port but client using dynamic port?
What software that you are using to analyst TCP header (refer to firewall.cx note)? Is it sniffer pro or ethereal / wireshark?
one more question..Port numbers is devide into 3 which is :
1. Well Known Port Numbers (0 through 1023)
2. Registered Port Numbers (1024 through 49151)
3. Dynamic Port Numbers (49152 through 65535)
Client will using registered port numbers & dynamic port numbers is it?
Why server is using fix port but client using dynamic port?
What software that you are using to analyst TCP header (refer to firewall.cx note)? Is it sniffer pro or ethereal / wireshark?
16 years 1 month ago #28155
by S0lo
Clients use a dynamic source port because they might have multiple processes (or connections) from the same client to one or more servers. If all processes (or connections) used the same fixed port then how will the reply packets from the server route to the write process (or connection) after it reaches the client?
Studying CCNP...
Ammar Muqaddas
Forum Moderator
www.firewall.cx
Replied by S0lo on topic Re: TCP Question
Yes.Client will using registered port numbers & dynamic port numbers is it?
Servers use a fixed port because clients need to know it when they initialize the connection. If it was dynamic, how can the clients know it?Why server is using fix port but client using dynamic port?
Clients use a dynamic source port because they might have multiple processes (or connections) from the same client to one or more servers. If all processes (or connections) used the same fixed port then how will the reply packets from the server route to the write process (or connection) after it reaches the client?
I personally use wireshark and commview.What software that you are using to analyst TCP header (refer to firewall.cx note)? Is it sniffer pro or ethereal / wireshark?
Studying CCNP...
Ammar Muqaddas
Forum Moderator
www.firewall.cx
Time to create page: 0.154 seconds