Subnet mask assignment in wireless module

I am using AirPrime MC7544 modem and get the IP address from ISP (Verizon) after SIM get initially registers. But do not know how the subnet mask and remote IP is assigned.

Is it generated and assigned locally within modem or not?

Example:
SIM IP Details:
IP : 10.7.8.45 (from ISP)
Mask: 255.255.255.252 (from ? )
Gateway:10.7.8.46

Hi,
For MC7544, when you connect device to PC, a peer to peer connection is established, PC will get device’s IP for PC’s interface. Device will not assign or generate any other IP
When device gets IP 10.7.8.45, so the PC’s interface will get that IP.
For subnet mask 255.255.255.252, the operator is assigned 2 Hosts in this subnet (.45 and .46), 1 IP broadcast .47

Thanks,

Locally. The network, broadcast and gateway addresses do not exist. They are artifacts for your routing table. The modem will actually forward traffic for all 3 to the ISP, so that you can reach other customers being assigned those addresses from the pool (if it weren’t for the firewall rules which probably forbid this).

The modem gets one address from the ISP. It calculates a mimimum netmask alllowing a virtual gateway address in the same subnet. The size of the subnet depends on how many of the least significant address bits are zero. The requirement is that “address & netmask != address”. The netmask must also allow one other address, for the virtual gateway, so the absolute longest mask possible is 255.255.255.252

You got 10.7.8.45. The LSB is set, so the modem can use the long mask. The gateway is then the only other possible address in that subnet.

If your ISP had assigned e.g. 10.7.8.64 to you instead, then the modem would have had to use a mask with 7 zero bits. I.e. 255.255.255.128. It could then use any of the 125 other addresses as gateway. I don’t know which one it will choose.

1 Like

Thanks for the detailed explanation for query on subnet mask. So, with this logic, mask is calculated at runtime within this modem. Can we somehow made this static for us, using any command or flag or API ?

Hi,
This IP address is allocated by your cellular network. If you need the static IP, you need to contact them.

Thanks,

1 Like

If your talking about the mask and gateway, then you can set them as you like without involving the modem in the decision. It doesn’t matter to anything outside the host. The modem will forward any packets you throw at it to the ISP, regardless of destination address. The only exception is the address assigned by the ISP, which is forwarded your way.

Thanks for explaining this. Our Sierra modem has received this ip: 10.139.128.0/30 which was a bit odd to me since it is the network address (.1 is the gwy) . I guess this makes sense since the modem assigns the subnet mask…?

it does look a bit odd, but it should work so I guess it’s fine.

Normally the modem will calculate the necessary bitmask to avoid the network address. But that would be excessive in this case, since you’ve been assigned an address ending in 15 zero bits. The lomgest possible netmask where that is not the network address is /16. I guess the modem firmware has some cutoff where it accepts such a “collision”.

The .0 and .255 addresses are sometimes excluded from pool configs because there are so many misbehaving clients. After all, it’s less than 1% wasted. But I guess the scarcity of IPv4 addresses makes that unpopular now, even for RFC1918 pools.

Thanks!! Appreciate the response!