The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
Google UNIX.COM


IP Networking Questions involving TCP/IP, Routers, Hubs, Network protocols, etc go here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to under stand the C code brain_full High Level Programming 4 02-15-2007 10:36 PM
Can under stand the script sam71 Shell Programming and Scripting 0 05-13-2005 01:54 PM
AF_UNIX versus AF_INET ivkumar Security 0 10-08-2002 09:38 AM
OEM - what does this abbreviation stand for? Kanu77 UNIX for Dummies Questions & Answers 3 03-25-2002 05:23 AM
No stand-by, keep on softarch UNIX for Dummies Questions & Answers 2 04-27-2001 01:40 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-01-2008
Registered User
 

Join Date: Dec 2007
Posts: 8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Question What does 'AF' of AF_INET stand for ?

as title. and how is it different from PF_INET ?

also, any one knows sin_family , sin_port , sin_addr ..etc ? why are they called 'sin' ?

finally, htons() host to network short , htonl() host to network long , ntohs() network to host short , ntohl() network to host long. why would programmers care about 'short' or 'long' here ? why not just use either one of them ?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-01-2008
Registered User
 

Join Date: Mar 2007
Location: Chennai
Posts: 221
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
I remember that AF stands for Address Family and PF stands for Protocol Family.

Also INET stands for INTERNET

The "Richard Stevens" Unix Network Programming book throws more light on that.

Thanks
Nagarajan G

Last edited by ennstate; 02-01-2008 at 01:28 AM. Reason: Answered INET question
Reply With Quote
  #3 (permalink)  
Old 02-01-2008
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,253
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
As for the long and short, one is 16 bits and the other 32 bits. You can't use 16 bits when you have 32 bits of data. The data won't fit and programmers care about that. You could use 32 bits when you have 16 bits of data, but you would be transmitting 16 bits of zeros for no good purpose. You would need to convince everyone else to do that. The protocols presently do not allow you to toss in extra zero bytes. But this would slow stuff down and waste space and programmers care about that.
Reply With Quote
  #4 (permalink)  
Old 02-01-2008
Registered User
 

Join Date: Dec 2007
Posts: 8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Question

Quote:
Originally Posted by Perderabo View Post
As for the long and short, one is 16 bits and the other 32 bits. You can't use 16 bits when you have 32 bits of data. The data won't fit and programmers care about that. You could use 32 bits when you have 16 bits of data, but you would be transmitting 16 bits of zeros for no good purpose. You would need to convince everyone else to do that. The protocols presently do not allow you to toss in extra zero bytes. But this would slow stuff down and waste space and programmers care about that.
thanks folks.

do you have an esay quick real example of what 32-bit(and 16-bit) data are like ?
Reply With Quote
  #5 (permalink)  
Old 02-01-2008
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,253
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
32 bit number...
Code:
$ nslookup www.unix.com
Server:  dslrouter
Address:  192.168.1.1

Non-authoritative answer:
Name:    www.unix.com
Address:  81.17.242.186

$
16 bit number...
Code:
$ grep http /etc/services
http               80/tcp    www www-http           #World Wide Web
https             443/tcp    MCom
https             443/udp    MCom
Reply With Quote
  #6 (permalink)  
Old 02-01-2008
Registered User
 

Join Date: Dec 2007
Posts: 8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Question

Quote:
Originally Posted by Perderabo View Post
32 bit number...
Code:
$ nslookup www.unix.com
Server:  dslrouter
Address:  192.168.1.1

Non-authoritative answer:
Name:    www.unix.com
Address:  81.17.242.186

$
16 bit number...
Code:
$ grep http /etc/services
http               80/tcp    www www-http           #World Wide Web
https             443/tcp    MCom
https             443/udp    MCom
i see... 32 bit is for ip , and 16 bit is for port. one quicky question: ip address consists of 2 parts, one is network address, the other is host address. since unix.com is at 81.17.242.186, what is its network as well as its host address ?
Reply With Quote
  #7 (permalink)  
Old 02-01-2008
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,253
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
I don't know what you mean. The ip address is all there is. It could be called network address. And it could be called host address.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes


The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash exec bash for loop command copy/move folder in unix couldn't set locale correctly curses.h cut command in unix daemon process export command in unix find grep find mtime find null character in a unix file grep multiple lines grep or grep recursive hp-ux ifconfig inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime ping port remove first character from string in k shell replace space by comma , perl script scp recursive segmentation fault(coredump) sftp script snoop unix stale nfs file handle syn_sent tar exclude tar extract to folder test: argument expected unix unix .profile unix forum unix forums unix interview questions unix simulator unix.com vi select all vi substitute vi+substitute+end+of+line+character while loop within while loop shell script


All times are GMT -7. The time now is 04:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101