Tuesday 9 June 2015

iperf to multicast addresses

1.Add multicast addresses to all sta(AP and STA connected) as below
        route add -net 224.0.0.0/4 dev eth0
2.At server
                Iperf –s –u –B 224.0.0.13 –I 1
3.client side

                Iperf –c 224.0.0.13 –u 1 1000 –T 5 –I 1

Ping - broadcast and multicast

The range of IP addresses is divided into "classes" based on the high order bits of a 32 bits IP address:

   Bit -->  0                           31            Address Range:
           +-+----------------------------+
           |0|       Class A Address      |       0.0.0.0 - 127.255.255.255
           +-+----------------------------+
           +-+-+--------------------------+
           |1 0|     Class B Address      |     128.0.0.0 - 191.255.255.255
           +-+-+--------------------------+
           +-+-+-+------------------------+
           |1 1 0|   Class C Address      |     192.0.0.0 - 223.255.255.255
           +-+-+-+------------------------+
           +-+-+-+-+----------------------+
           |1 1 1 0|  MULTICAST Address   |     224.0.0.0 - 239.255.255.255
           +-+-+-+-+----------------------+
           +-+-+-+-+-+--------------------+
           |1 1 1 1 0|     Reserved       |     240.0.0.0 - 247.255.255.255

Every IP datagram whose destination address starts with "1110" is an IP Multicast datagram.
The remaining 28 bits identify the multicast "group" the datagram is sent to. You need to tune radio and kernel to receive packets sent to an specific multicast group. This is called joining a multicast group.

Some of the special (well known/reserved) multicast groups are:
·         224.0.0.1 is the all-hosts group. If you ping that group, all multicast capable hosts on the network should answer, as every multicast capable host must join that group at start-up on all it's multicast capable interfaces.
·         224.0.0.2 is the all-routers group. All multicast routers must join that group on all it's multicast capable interfaces.

Multicast ping: 
Get multicast address using "netstat -g" command

$ netstat -g
IPv6/IPv4 Group Memberships
Interface       RefCnt Group
--------------- ------ ---------------------
eth1            1      224.0.0.251
eth0            1      224.0.0.251

Ping to multicast address, you will get reply from multicast registered IPs.

$ ping -I eth0 224.0.0.251
PING 224.0.0.251 (224.0.0.251) from 11.191.136.143 eth0: 56(84) bytes of data.
64 bytes from 11.191.136.223: icmp_req=1 ttl=64 time=0.249 ms
64 bytes from 11.191.136.222: icmp_req=1 ttl=64 time=0.257 ms (DUP!)


Ping to all-host multicast address.
$ ping -I eth0 224.0.0.1

Broadcast ping:

$ ping -I eth0 -b 255.255.255.255

Thursday 4 June 2015

AMSDU and AMPDU

Data Link Layer Sub-Layers...

1. LLC (Logical link Control):- Name itself describes that it is responsible for handling layer-3 protocols (multiplexing/de-multiplexing), flow control and reliability. This is upper sub-layer of Data Link Layer.
2. MAC (Medium Access Control): It is responsible for controlling medium access, framing/de-framing, check-sum computation and verification.


Upper and Lower sub-layers of Data Link Layer


Packets, Frames...etc, what is it called at each layer....




MSDU, MPDU, PSDU...



MSDU: The MSDU is the service data unit that is received from the logical link control (LLC)
MPDU: The MPDU is a message (Protocol data unit) exchanged between media access control (MAC) entities in a communication system.


AMSDU and AMPDU...




AMSDU........................





Why AMSDU:
  1.  Ethernet is the native frame format
  2.  Ethernet header is much smaller than the 802.11 header
Hence multiple Ethernet frames can be combined to form a single A-MSDU.  
A-MSDU minimizes the MAC header overheads when the channel conditions are good.
  
Issue with AMSDU:
Probability of error increases with frame size. Since each AMSDU has one MAC frame and one CRC, in case of error whole frame needs to be re-transmitted (in most cases at lower rates). So it is better to use it in good channel conditions.

AMSDU Beacon:



AMSDU Packet exchange:




AMPDU....................



Why AMPDU:
Multiple PDUs are aggregated, each with their own MAC header and CRCs. Hence, in the event of a failure, only those MPDUs can be retransmitted resulting in higher efficiency.

However, each MPDU in AMPDU has its own header and CRC, it adds to overhead but by using Block Ack mechanism this can be overridden.

Beacon of AMPDU enabled AP:



AMPDU Packet exchange: