Raw Ethernet PF_PACKET issue on localhost

I am working on raw ethernet programming in c. I have two files client and server which are running on localhost. I am using my own protocol number for communication in socket().On the client side i have follwing code s = socket(PF_PACKET, SOCK_RAW, 61187); unsigned char dest_mac[6]= {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; struct sockaddr_ll socket_address; socket_address.sll_family = PF_PACKET; socket_address.sll_protocol = 61187; socket_address.sll_ifindex = ifindex; socket_address.sll_hatype = AR...Read more

raw ethernet - 64/66b encoding

There are a few things I don't understand about 64/66bit encoding, and failed to find the answers to on the web. Any help/links would be greatly appreciated:i) how is the start of a frame recognised? I don't think it can be by the initial 10/01 bits called the preamble on wikipedia because you cannot tell them apart (if an idle link is 0, then 0000 10 and 000 01 0 look rather similar). I expect the end of a frame is indicated by a control word, with the rest of the bits perhaps used for the CRC?ii) how do the scramblers synchronise, and how do...Read more