Designing a WLan Receiver - networking

I plan to model a Complete WLAN receiver for IEEE 802.11 b/g/n PHY Layer for completely detecting all the fields in the Packet.
This experiment is for academic purpose only. I am seeking your guidance, how I can build such a model.
Any ideas / pointers for designing such a receiver would be highly helpful for my studies.
Looking forward to hear some interesting ideas.
Thanks
Kiran

With the new 802.11 framework in Linux you can just put an interface into monitor mode, and then capture frames with libpcap. No need for special hacks. Actually you don't even need any programming skills for some experimentation: just put your wlan0 into monitor mode, and start sniffing around with tcpdump.

Related

Is ARP contained into MAC sublayer (OSI Model)?

Well, I've read that the Data Link layer is further divided into LLC and MAC sublayers.
However, the description of the MAC functions seems just like what the ARP does, which left me a bit confused.
Is the MAC sublayer a purely conceptual thing while the ARP is a concrete implementation?
Thanks in advance for your patience :)
The main point of the MAC sublayer of the data-link layer is to abstract hardware details to the LLC, which is often implemented in software. Therefore the way, how an ARP request is implemented actually depends on the physical medium below - but I'd say ARP in general is just a service part of the MAC layer whose implementation depends on various linklayer protocols (e.g. Ethernet vs Wifi).

Is MAC (Media Access Control) considered a protocol?

I am currently learning about networking. I am going through the TCP IP and OSI model and try to pick apart what protocol belongs to which layer. I am a bit confused over Media Access Control. Does it just refer to the hardware id of the network card or is it the name of the protocol responsible for it? I tried to find any RFCs for MAC on IETF to provide some definitions for me, but I couldn't find anything.
"MAC" stands for media access control - it's a sublayer of the data link layer (L2) in the OSI model.
One of the most popular protocols in this layer is Ethernet which covers the physical layer and the data link layer. You can find all about Ethernet at IEEE 802.3 (requires registration but is free).
Another extremely popular L1/L2 protocol stack is WiFi (IEEE 802.11) but that's a lot more complicated and hard to start with.
No, the MAC is not a protocol in that you won't find any 'MAC spec' that you can implement. MACs are typically embedded in hardware devices and expose functionality to send and receive frames to the media that they're controlling.
How they expose that functionality is up to the manufacturer of the MAC. They don't follow any standard protocol. You might find simple SPI interfaces, register-based access, DMA transfer or others.

How to simulate tcp/ip network protocol stack in usermode

I want to simulate tcp/ip network protocol so that I can debug it and learn how it works.I just want to implement a small part of it,but I don't know how to start,what should I do ?
Any help will be grateful...
Learning NS-2 would be a good start: http://www.isi.edu/nsnam/ns/ . This is a popular simulator that is widely used in research/academics and has a rich collection of TCP congestion protocols.

Linux TCP stack packet injection

Could i inject packets to Linux TCP stack without modifying the ethernet driver? Could i do this with using a library or sth ?
Thank you,
If by 'inject packets to Linux TCP stack' you mean send some data that the Linux kernel will treat as a frame coming from an Ethernet interface then you can use a 'tap' device. If an IP packet (layer 3) is good enough, then use a 'tun' device.
http://en.wikipedia.org/wiki/TUN/TAP
http://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/Documentation/networking/tuntap.txt
Libnet
Libnet is a generic networking API that provides access to several protocols. It is not designed as a 'all in one' solution to networking. Currently many features that are common in some network protocols are not available with Libnet, such as streaming via TCP/IP. We feel that Libnet should not provide specific features that are possible in other protocols. If we restrict Libnet to the minimal needed to communicate (datagram/packets) then this allows it to support more interfaces.
Otherwise, if you're just wondering about injecting hand-crafted packets into the network, read the man pages and look for online help with raw sockets. Some good places to start are man 7 raw, man packet, and there are some ok tutorials at security-freak.net, though the code there is not written particularly well for my tastes.

How Ethernet receives the bits and forms the Data Link Layer Frame

I am curious to know how the incoming bits at the physical layer are properly framed and sent to the data link layer. How the OS deal with this process.
It would be grateful if you explained it in detail or give me some links/pdf.
I am interested to know in depth about Layer 1 and 2 operations.
Advance Thanks.
The physical layer depends on your hardware. You're probably connected via ethernet, see here. The operating system doesn't do a lot here, it's mostly left up to the network card and the device drivers written by the card's manufacturer.
The good thing about today, is you seldom have to remember anything but Google.
http://en.wikipedia.org/wiki/Ethernet
However, the question is NOT about the physical layer as that is really the wires and interfaces for the wires; hence physical connections. His questions addresses the Data-Link layer in OSI Model terms.
As Ethernet Does not match the OSI model and the fact that the OSI model is a strategic rather than a tactical model, in Ethernet terms you are interested in the 802.3 MAC Frame. But then as Ethernet is old, there are actually a several of different EtherTypes.
For sharing the data, some protocol is needed as human .so here 7 layers are given .
Physical layer direct connect with the hardware( when pulse sends in Bit format ).
It deals with mechanical and electrical specification of the interface and transmission medium.
OS have only authority to run the application not any participation in any software .
If you want detail then better read SIGNAL AND SYSTEM.

Resources