Skip to contentSkip to conversation

Must every packet have a creating socket? (was Re: Does a forwarded packet has a local socket with it?)

DISCUSSION Park Lee 3 participants 3 messages Apr 20, 2005 – Apr 22, 2005

Subsystems (2)
lore
Share & tools
lore

Park Lee

author
#0 lore raw
Quoted 15 lines · Neil Horman

Not sure what your asking here. Asking "Does these two sockets belong to local socket?" is a pretty meaningless question, as the terminology is nonsensical. All sockets have a protocol associated with them (except raw sockets, but thats another topic). When you create a socket you associate it with a protocol family (AF_INET, AF_INET6, AF_NETLINK, AF_APPLETALK, etc),
a connection type (SOCK_STREAM for connection oriented protocols, SOCK_DGRAM for connection-less protocols), and a protocol (IPPROTO_TCP, IPPROTO_UDP, etc). Depending on the family, type and protocol you select, you can talk to different systems/services.

Quoted 1 line

Does that answer your question?

Thanks a lot.

Can I think that every packet (e.g. IP packet) must have a corresponding creating socket? (i.e. Must every packet be created by a socket?)
Is there any other way to originate a packet?

Thank you.

Best Regards,
Park Lee

__________________________________
Do you Yahoo!?
Make Yahoo! your home page
http://www.yahoo.com/r/hs

#1 lore raw
Quoted 3 lines

Can I think that every packet (e.g. IP packet) must have a corresponding creating socket? (i.e. Must every packet be created by a socket?)

No. ICMP messages come to mind - although I _suppose_ that since those are in response to other traffic, you could claim it was in response to something sent from a "socket" or "endpoint" - depends on how far away you consider it to still be from a socket.

Quoted 12 lines

Is there any other way to originate a packet?

Thank you.

Best Regards,
Park Lee

__________________________________ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs

#2 lore raw

Re: Must every packet have a creating socket?

Quoted 8 lines · Rick Jones
Quoted 3 lines

Can I think that every packet (e.g. IP packet) must have a corresponding creating socket? (i.e. Must every packet be created by a socket?)

No. ICMP messages come to mind - although I _suppose_ that since those are in response to other traffic, you could claim it was in response to something sent from a "socket" or "endpoint" - depends on how far away you consider it to still be from a socket.

Actually Linux has kernel private sockets for ICMP. Very old Linux didnt, but it required ugly special cases in the transmit path, so it was removed.

-Andi