tcp - How do sockets and ethernet work together? -
say have 2 computers connected single ethernet cable, using tcp/ip. if computer 1 connects computer 2 using port 12345, , computer 2 connects computer 1 port 54321, happens when both computers sending constant flow of data simultaneously?
do computers each half of ethernet cable use 1 way pipes or take turns sending data through ethernet cable 1 piece of data being transmitted through @ time?
on physical layer (and assuming regular cat5 tp cables , ethernet hardware), each communication partner has own pairs of wires, allowing both send , receive @ same time. called full duplex operation. in older hardware, such token ring, several computers must share same lines , can use full duplex in special situations.
luckily (as has been pointed out), tcp/ip sockets work on higher layer in protocol stack, highly abstracted actual type of physical access. can have many open connections between 2 parters want, virtually @ least. network stack wraps communication packets, marks port numbers, source , destination addresses , hands off next layer until reaches medium. so, port numbers , sockets logical , barely have actual hardware. don't need network hardware kind of sockets.
in fact, whole scheme more complicated , recommend reading network socket on wp short introduction on how sockets work , do. more information, andrew tanenbaum's computer networks book covers relevant details , easy readable.
Comments
Post a Comment