Networking Forums

Networking Forums > Computer Networking > Linux Networking > simple q on IP address and port number

Reply
Thread Tools Display Modes

simple q on IP address and port number

 
 
dew
Guest
Posts: n/a

 
      03-23-2007, 09:09 AM
Can anyone tell me whether the Source port(eg., 8080,etc) ,dest port
are in decimal format.And how many bits does it take up.There can be
65535 ports.so 16 bits am i right?
Also, the tcp,ip,udp,other protocols have a protocol number.So, that
is represented by how many bits?


Thank You

 
Reply With Quote
 
 
 
 
sairam
Guest
Posts: n/a

 
      03-23-2007, 09:25 AM

dew wrote:
> Can anyone tell me whether the Source port(eg., 8080,etc) ,dest port
> are in decimal format.And how many bits does it take up.There can be
> 65535 ports.so 16 bits am i right?
> Also, the tcp,ip,udp,other protocols have a protocol number.So, that
> is represented by how many bits?
>
>
> Thank You


For the First question your answer is right.It takes 2 bytes i.e.,16
bits.
For the Second question,
you said ip,tcp and udp i.e., the IP layer is the base layer for both
TCP and UDP protocols. So in MAC Layer the Protocol lentgh is 2 bytes
i.e,IP or some other one but in IP layer its 1byte specifying TCP or
UDP, and there will be no protocol number mentioned in TCP layer it
distinguishes the protocol depending on some pre-defined port numbers
for a particular port number.

 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      03-23-2007, 06:53 PM
On 23 Mar 2007, in the Usenet newsgroup comp.os.linux.networking, in article
<(E-Mail Removed). com>, dew wrote:

> Can anyone tell me whether the Source port(eg., 8080,etc) ,dest port
> are in decimal format.And how many bits does it take up.There can be
> 65535 ports.so 16 bits am i right?


It's a 16 bit number. How you represent 16 bits is up to you. Most
people speak in decimal, but the protocol represents it as a binary.
See the appropriate specification

0768 User Datagram Protocol. J. Postel. August 1980. (Format: TXT=5896
bytes) (Also STD0006) (Status: STANDARD)

0793 Transmission Control Protocol. J. Postel. September 1981.
(Format: TXT=172710 bytes) (Updated by RFC3168) (Also STD0007)
(Status: STANDARD)

Remember that any service _MIGHT_ use any port number. There exists a
number of "well-known" port numbers where you can expect to find a
service, but just because something is using port $FOO does NOT mean that
it must be service $BAR. See http://www.iana.org/assignments/port-numbers

> Also, the tcp,ip,udp,other protocols have a protocol number.So, that
> is represented by how many bits?


See RFC0791 section 3.1 - or read your textbook. For a list of those
protocols see http://www.iana.org/assignments/protocol-numbers

0791 Internet Protocol. J. Postel. September 1981. (Format: TXT=97779
bytes) (Obsoletes RFC0760) (Updated by RFC1349) (Also STD0005)
(Status: STANDARD)

You can find the RFCs using the search engine you are posting from.
Oh, and please stop posting the same article to multiple groups. You
are acting like a spammer when you do so.

Old guy
 
Reply With Quote
 
dew
Guest
Posts: n/a

 
      03-24-2007, 12:16 PM
On Mar 24, 12:53 am, ibupro...@painkiller.example.tld (Moe Trin)
wrote:
> On 23 Mar 2007, in the Usenet newsgroup comp.os.linux.networking, in article
>
> <1174644586.339950.214...@e1g2000hsg.googlegroups. com>, dew wrote:
> > Can anyone tell me whether theSourceport(eg., 8080,etc) ,destport
> > are in decimal format.And how many bits does it take up.There can be
> > 65535 ports.so 16 bits am i right?

>
> It's a 16 bitnumber. How you represent 16 bits is up to you. Most
> people speak in decimal, but theprotocolrepresents it as a binary.
> See the appropriate specification
>
> 0768 User DatagramProtocol. J. Postel. August 1980. (Format: TXT=5896
> bytes) (Also STD0006) (Status: STANDARD)
>
> 0793 Transmission ControlProtocol. J. Postel. September 1981.
> (Format: TXT=172710 bytes) (Updated by RFC3168) (Also STD0007)
> (Status: STANDARD)
>
> Remember that any service _MIGHT_ use anyportnumber. There exists anumberof "well-known"portnumbers where you can expect to find a
> service, but just because something is usingport$FOO does NOT mean that
> it must be service $BAR. Seehttp://www.iana.org/assignments/port-numbers
>
> > Also, the tcp,ip,udp,other protocols have aprotocolnumber.So, that
> > is represented by how many bits?

>
> See RFC0791 section 3.1 - or read your textbook. For a list of those
> protocols seehttp://www.iana.org/assignments/protocol-numbers
>
> 0791 InternetProtocol. J. Postel. September 1981. (Format: TXT=97779
> bytes) (Obsoletes RFC0760) (Updated by RFC1349) (Also STD0005)
> (Status: STANDARD)
>
> You can find the RFCs using the search engine you are posting from.


> Old guy


ok thanks and
> Oh, and please stop posting the same article to multiple groups. You
> are acting like a spammer when you do so.
>

sorry abt that

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the 5th number in ip address Jeff Wireless Networks 6 03-16-2006 10:38 PM
increase the number of port ranges? Kevin Blount Wireless Internet 5 01-11-2006 05:16 PM
can ping with number address but not with name address Terry Liittschwager Linux Networking 5 01-11-2006 09:40 AM
UDP source port number when using RAW socket?? Andreas Linux Networking 0 06-28-2004 10:34 AM
Routing by port number Bill Davidsen Linux Networking 3 12-21-2003 12:53 AM



1 2 3 4 5 6 7 8 9 10 11