Galle, LK--:--5/6 sites live

Networking 04 — IP Addressing: Classful, Subnetting, CIDR, NAT, DHCP and IPv6

IPv4 addresses bit by bit, public vs private, special ranges, classful subnetting, supernetting and CIDR, NAT, DHCP and IPv6.

4 Aug 20266 min readSelf Guide · Stage 2#IP#Subnetting#CIDR#NAT#Sinhala

These notes began as two handwritten notebooks for COM 3401 — Data Communication and Networking at Rajarata University. I OCR'd them, rewrote them in English, and paired every section with a Sinhala explanation so the concept comes first and the English terms stay intact for the exam. Diagrams are redrawn as vector graphics.

IP Address

අයිපී ලිපිනය

An IP address is a series of numbers that identifies any device on a network. An IPv4 address is a 32 bit number.

සිංහලෙන්: IP ලිපිනයක් යනු ජාලයක ඕනෑම උපාංගයක් හඳුනා ගන්නා අංක මාලාවකි. IPv4 ලිපිනයක් යනු බිටු 32 අංකයකි.

Computers use IP addresses to communicate with each other and with other networks as well.

සිංහලෙන්: පරිගණක එකිනෙකා සමඟ සහ අනෙකුත් ජාල සමඟ සන්නිවේදනය කිරීමට IP ලිපින භාවිතා කරයි.

The format is four numbers separated by dots, and every single number can have a value between 0 and 255. For example in 192.168.2.30 the first part is the network address and the last part is the device address.

සිංහලෙන්: ආකෘතිය තිත් වලින් වෙන් කර ඇති අංක හතරක් වන අතර, සෑම තනි අංකයකටම 0 සහ 255 අතර අගයක් තිබිය හැක. උදාහරණයක් ලෙස 192.168.2.30 හි පළමු කොටස ජාල ලිපිනය වන අතර අවසාන කොටස උපාංග ලිපිනය වේ.

Global IP and Local IP

ගෝලීය සහ ස්ථානීය අයිපී

ISP router devices

ISP → Router → Devices (Global IP vs Local IP)

The Internet Service Provider gives one global IP address to your modem or router. Any device connected to that modem will appear on the internet with the same global IP address.

සිංහලෙන්: අන්තර්ජාල සේවා සපයන්නා ඔබගේ මොඩමයට හෝ රවුටරයට එක් ගෝලීය IP ලිපිනයක් ලබා දෙයි. එම මොඩමයට සම්බන්ධ ඕනෑම උපාංගයක් එකම ගෝලීය IP ලිපිනය සමඟ අන්තර්ජාලයේ දිස්වනු ඇත.

In addition, the modem or router gives all the connected devices their own separate local IP addresses with the help of DHCP.

සිංහලෙන්: මීට අමතරව, මෝඩමය හෝ රවුටරය DHCP ආධාරයෙන් සියලුම සම්බන්ධිත උපාංගවලට ඔවුන්ගේම වෙනම දේශීය IP ලිපින ලබා දෙයි.

Special IP Addresses

විශේෂ අයිපී ලිපින

Six combinations of network id and host id have a special meaning, and some of them can only be used as a source address while others can only be used as a destination address.

සිංහලෙන්: ජාල හැඳුනුම්පත සහ ධාරක හැඳුනුම්පතේ සංයෝජන හයකට විශේෂ අර්ථයක් ඇති අතර, ඒවායින් සමහරක් මූලාශ්‍ර ලිපිනයක් ලෙස පමණක් භාවිතා කළ හැකි අතර අනෙක් ඒවා ගමනාන්ත ලිපිනයක් ලෙස පමණක් භාවිත කළ හැකිය.

  • Network id filled and host id all zeros, for example 10.0.0.0 or 192.168.1.0. This is called the network address and it is used by the router to identify the network to which a packet belongs. It cannot be used as a source or a destination address.
  • Network id filled and host id all ones, for example 150.157.255.255. This is the directed broadcast address, used for delivering packets to all systems in some other network.
  • Network id all ones and host id all ones, that is 255.255.255.255. This is the limited broadcast address, used for delivering packets to all systems in our own network.
  • Network id all zeros and host id all zeros, that is 0.0.0.0. This is the address a host uses before it has an address of its own, when it asks a DHCP server for one. It can be used only as a source address.
  • Network id all zeros and host id filled, for example 0.0.0.100. This means a specific host in this network and is used for local communication.
  • Anything starting with 127, for example 127.1.1.1. This is the loopback address used for inter process communication and for self checking of connectivity. Note that 127.0.0.0 and 127.255.255.255 are not valid, but every other address starting with 127 is.

සිංහලෙන්: ජාල හැඳුනුම්පත පුරවා ධාරක හැඳුනුම්පත සියලු බිංදු, උදාහරණයක් ලෙස 10.0.0.0 හෝ 192.168.1.0. මෙය ජාල ලිපිනය ලෙස හඳුන්වන අතර පැකට්ටුවක් අයත් වන ජාලය හඳුනා ගැනීමට රවුටරය භාවිතා කරයි. එය මූලාශ්‍රයක් හෝ ගමනාන්ත ලිපිනයක් ලෙස භාවිත කළ නොහැක.ජාල හැඳුනුම්පත පුරවා සත්කාරක හැඳුනුම්පත සියල්ලම, උදාහරණයක් ලෙස 150.157.255.255. මෙය වෙනත් ජාලයක සියලුම පද්ධති වෙත පැකට් බෙදා හැරීම සඳහා භාවිතා කරන අධ්‍යක්ෂණය කළ විකාශන ලිපිනයයි.ජාල හැඳුනුම්පත සියල්ල සහ සත්කාරක හැඳුනුම්පත සියල්ල, එනම් 255.255.255.255 වේ. මෙය අපගේම ජාලයේ සියලුම පද්ධති වෙත පැකට් බෙදා හැරීම සඳහා භාවිතා කරන සීමිත විකාශන ලිපිනයයි.ජාල හැඳුනුම්පත සියලු බිංදු සහ සත්කාරක හැඳුනුම්පත සියලු බිංදු, එනම් 0.0.0.0 වේ. මෙය DHCP සේවාදායකයකින් එකක් ඉල්ලා සිටින විට, ධාරකයෙකුට තමන්ගේම ලිපිනයක් තිබීමට පෙර භාවිතා කරන ලිපිනය මෙයයි. එය භාවිතා කළ හැක්කේ මූලාශ්‍ර ලිපිනයක් ලෙස පමණි.ජාල හැඳුනුම්පත සියලු ශුන්‍ය සහ ධාරක හැඳුනුම්පත පුරවා ඇත, උදාහරණයක් ලෙස 0.0.0.100. මෙයින් අදහස් කරන්නේ මෙම ජාලයේ විශේෂිත ධාරකයක් වන අතර එය දේශීය සන්නිවේදනය සඳහා භාවිතා වේ.127 න් ආරම්භ වන ඕනෑම දෙයක්, උදාහරණයක් ලෙස 127.1.1.1. අන්තර් ක්‍රියාවලි සන්නිවේදනය සඳහා සහ සම්බන්ධතා ස්වයං පරීක්ෂාව සඳහා භාවිතා කරන ලූප්බැක් ලිපිනය මෙයයි. 127.0.0.0 සහ 127.255.255.255 වලංගු නොවන බව සලකන්න, නමුත් 127 න් ආරම්භ වන අනෙකුත් සෑම ලිපිනයක්ම වලංගු වේ.

Classful Addressing and Subnetting

පන්ති අනුව ලිපිනකරණය සහ උපජාලකරණය

In classful addressing the first bits of the address decide the class. A class A address uses eight bits for the network id, class B uses sixteen bits and class C uses twenty four bits. That is why a slash eight prefix means class A, a slash sixteen prefix means class B and a slash twenty four prefix means class C.

සිංහලෙන්: පන්ති ආමන්ත්‍රණයේදී ලිපිනයේ මුල් බිටු පන්තිය තීරණය කරයි. A පන්තියේ ලිපිනයක් ජාල හැඳුනුම්පත සඳහා බිටු අටක් භාවිතා කරයි, B පන්තියේ බිටු දහසයක් සහ C පන්තියේ බිටු විසි හතරක් භාවිතා කරයි. slash අට උපසර්ගය යනු A පන්තිය ද, slash දහසය උපසර්ගය B පන්තිය ද, slash විසි හතර උපසර්ගය යනු C පන්තිය ද යනු එබැවිනි.

A subnet mask is also a 32 bit system and it is used to indicate whether subnets are available or not in the network. If available, it will give the information about the number of bits borrowed from the host id and their position, based on the following two rules.

සිංහලෙන්: සබ්නෙට් මාස්ක් යනු බිට් 32 පද්ධතියක් වන අතර එය ජාලයේ උපජාල තිබේද නැද්ද යන්න දැක්වීමට භාවිතා කරයි. තිබේ නම්, එය පහත සඳහන් නීති දෙක මත පදනම්ව, ධාරක හැඳුනුම්පතෙන් ණයට ගත් බිටු ගණන සහ ඒවායේ පිහිටීම පිළිබඳ තොරතුරු ලබා දෙනු ඇත.

  • The number of ones in the subnet mask indicates the network id plus the subnet id.
  • The number of zeros indicates the host id part.

සිංහලෙන්: සබ්නෙට් මාස්ක් එකේ ඇති සංඛ්‍යාවෙන් ජාල හැඳුනුම්පත සහ උපජාල හැඳුනුම්පත දක්වයි.බිංදු ගණන සත්කාරක හැඳුනුම්පත කොටස දක්වයි.

Subnet mask bit layout

Subnet mask 255.255.255.192 on a class C network

For example, consider a class C network with the subnet mask 255.255.255.192. The last byte in binary is 11000000, so the network id plus subnet id is 26 bits and the host id is 6 bits. The number of bits borrowed is two and their positions are the 128 bit and the 64 bit. The possible subnets are two to the power two which is four, their subnet ids are 0, 64, 128 and 192, and the number of systems per subnet is two to the power six minus two, which is 62.

සිංහලෙන්: උදාහරණයක් ලෙස, උපජාල ආවරණ 255.255.255.192 සමඟ C පන්තියේ ජාලයක් සලකා බලන්න. ද්විමය වල අවසාන බයිටය 11000000 වේ, එබැවින් ජාල හැඳුනුම්පත සහ උපජාල හැඳුනුම්පත බිටු 26 ක් වන අතර සත්කාරක හැඳුනුම්පත බිටු 6 කි. ණයට ගත් බිටු ගණන දෙකක් වන අතර ඒවායේ ස්ථාන 128 බිට් සහ 64 බිට් වේ. විය හැකි උපජාල බල දෙකට එනම් හතරට දෙකකි, ඒවායේ උපජාල id 0, 64, 128 සහ 192 වන අතර, එක් උපජාලයකට පද්ධති සංඛ්‍යාව බලය හයේ සිට දෙකෙන් දෙකක් වන අතර එය 62 වේ.

As a second example, consider a class C network with the subnet mask 255.255.255.15. The last byte is 00001111, so the network id plus subnet id is 28 bits, four bits are borrowed, their positions are 1, 2, 4 and 8, the possible number of subnets is sixteen, and the number of systems per subnet is two to the power four minus two, which is fourteen.

සිංහලෙන්: දෙවන උදාහරණයක් ලෙස, උපජාල ආවරණ 255.255.255.15 සමඟ C පන්තියේ ජාලයක් සලකා බලන්න. අවසාන බයිටය 00001111 වේ, එබැවින් ජාල හැඳුනුම්පත සහ උපජාල හැඳුනුම්පත බිට් 28 කි, බිට් හතරක් ණයට ගෙන ඇත, ඒවායේ ස්ථාන 1, 2, 4 සහ 8, විය හැකි උපජාල සංඛ්‍යාව දහසය, සහ එක් උපජාලයකට පද්ධති සංඛ්‍යාව බලය හතරෙන් දෙකට දෙකකි, එනම් දහහතරකි.

When you are asked to propose a subnet mask, first check whether the requirement fits inside the class. For a class C network with 7 subnets each with 25 systems, 7 multiplied by 25 is 175, which is less than 256, so it is possible, and 3 bits must be borrowed because 2 to the power 3 is 8 which covers 7 subnets. But for a class C network with 20 subnets each with 15 systems, 20 multiplied by 15 is 300, which is greater than 256, so it is not possible.

සිංහලෙන්: සබ්නෙට් මාස්ක් එකක් යෝජනා කිරීමට ඔබෙන් ඉල්ලා සිටින විට, එම අවශ්‍යතාවය පන්තියට ගැලපේදැයි පළමුව පරීක්ෂා කරන්න. පද්ධති 25 බැගින් ඇති උපජාල 7 බැගින් ඇති C පන්තියේ ජාලයක් සඳහා, 25 න් ගුණ කළ විට 7 175 වේ, එය 256 ට අඩු බැවින් එය කළ හැකි අතර, 2 සිට බලය 3 දක්වා 8 වන බැවින් උපජාල 7 ක් ආවරණය වන බැවින් බිටු 3 ක් ණයට ගත යුතුය. නමුත් පද්ධති 15 බැගින් ඇති උපජාල 20 බැගින් ඇති C පන්තියේ ජාලයක් සඳහා, 20 න් 15 න් ගුණ කළ විට 300 වන අතර එය 256 ට වඩා වැඩි බැවින් එය කළ නොහැක.

When the subnets are of different sizes, a single fixed mask cannot serve all of them, and in order to propose an appropriate subnet mask we use the concept of a variable length subnet mask, or VLSM. For example, to make subnets of 75, 35, 25 and 18 systems in a class C network, you use 255.255.255.128 for the large one and 255.255.255.192 and 255.255.255.224 for the smaller ones.

සිංහලෙන්: උපජාල විවිධ ප්‍රමාණවලින් ඇති විට, තනි ස්ථාවර වෙස් මුහුණකට ඒ සියල්ලට සේවය කළ නොහැකි අතර, සුදුසු උපජාල ආවරණයක් යෝජනා කිරීම සඳහා අපි විචල්‍ය දිග උපජාල ආවරණයක් හෝ VLSM සංකල්පය භාවිතා කරමු. උදාහරණයක් ලෙස, C පන්තියේ ජාලයක 75, 35, 25 සහ 18 පද්ධතිවල උපජාල සෑදීම සඳහා, ඔබ විශාල එක සඳහා 255.255.255.128 සහ කුඩා ඒවා සඳහා 255.255.255.192 සහ 255.255.255.224 භාවිතා කරයි.

Supernetting and CIDR

සුපර්නෙටිං සහ සීඅයිඩීආර්

A supernet mask is also a 32 bit system, used to generate a single IP address for a group of networks, based on the following two rules. The number of ones in the supernet mask indicates the fixed part and the number of zeros indicates the variable part.

සිංහලෙන්: සුපර්නෙට් මාස්ක් යනු පහත සඳහන් නීති දෙක මත පදනම්ව ජාල සමූහයක් සඳහා තනි IP ලිපිනයක් උත්පාදනය කිරීමට භාවිතා කරන බිට් 32 පද්ධතියකි. සුපර්නෙට් මාස්ක් එකෙහි ඇති සංඛ්‍යාවෙන් ස්ථාවර කොටස ද බිංදු ගණනින් විචල්‍ය කොටස ද දක්වයි.

For example, the four class C networks 192.192.0.0, 192.192.1.0, 192.192.2.0 and 192.192.3.0 differ only in the last two bits of the third byte, so the supernet mask is 255.255.252.0 and the combined block is written as 192.192.0.0 slash 22. That block contains 256 multiplied by 4, which is 1024 addresses.

සිංහලෙන්: උදාහරණයක් ලෙස, 192.192.0.0, 192.192.1.0, 192.192.2.0 සහ 192.192.3.0 පන්තියේ C ජාල හතර වෙනස් වන්නේ තුන්වන බයිටයේ අවසාන බිටු දෙකෙහි පමණි, එබැවින් සුපර්නෙට් මාස්ක් එක 255.255.252.0 ලෙස ලියා ඇත. 22. එම බ්ලොක් එකේ 256 ගුණ කළ 4, එනම් ලිපින 1024 ක් අඩංගු වේ.

Classless inter domain routing, or CIDR aggregation, is another name for supernetting. The key difference is that in a subnet mask the number of ones is equal to or more than the network id bits and the bits are borrowed from the host id, while in a supernet mask the number of ones is always less than the network id bits and the bits are borrowed from the network id. A subnet mask applies to a single network, while a supernet mask applies to two or more networks.

සිංහලෙන්: Classless inter domain routing, හෝ CIDR aggregation, supernetting සඳහා තවත් නමකි. ප්‍රධාන වෙනස නම් සබ්නෙට් මාස්ක් එකක ඒවායේ සංඛ්‍යාව ජාල හැඳුනුම්පත බිටුවලට සමාන හෝ වැඩි වන අතර බිට් ධාරක හැඳුනුම්පතෙන් ණයට ගන්නා අතර සුපර්නෙට් මාස්ක් එකක සංඛ්‍යාව සෑම විටම ජාල හැඳුනුම්පත බිට් වලට වඩා අඩු වන අතර බිට් ජාල හැඳුනුම්පතෙන් ණයට ගනී. උපජාල ආවරණයක් තනි ජාලයකට අදාළ වන අතර සුපර්නෙට් මාස්ක් ජාල දෙකකට හෝ වැඩි ගණනකට අදාළ වේ.

NAT

එන්ඒටී

NAT stands for Network Address Translation. When a device connected to the router sends a request, it goes to the ISP and then to the server. The data is received on the public or global IP address by the network, and then it is sent to the respective device local IP with the help of NAT.

සිංහලෙන්: NAT යනු ජාල ලිපින පරිවර්තනයයි. රවුටරයට සම්බන්ධ උපාංගයක් ඉල්ලීමක් යවන විට, එය ISP වෙත ගොස් පසුව සේවාදායකයට යයි. ජාලය විසින් පොදු හෝ ගෝලීය IP ලිපිනය මත දත්ත ලබා ගන්නා අතර පසුව එය NAT සහාය ඇතිව අදාළ උපාංගය දේශීය IP වෙත යවනු ලැබේ.

NAT identifies the local IP addresses of the devices and masks their port numbers as well, so that no two devices or hosts will have the same port number.

සිංහලෙන්: NAT විසින් උපාංගවල ප්‍රාදේශීය IP ලිපින හඳුනාගෙන ඒවායේ වරාය අංක ද වසං කරයි, එවිට කිසිදු උපාංග දෙකකට හෝ ධාරකයකට එකම තොට අංකයක් නොතිබෙනු ඇත.

The idea of NAT is to allow multiple devices to access the internet through a single public address. To achieve this, the translation of a private IP address to a public IP address is required.

සිංහලෙන්: NAT හි අදහස වන්නේ එක් පොදු ලිපිනයක් හරහා බහුවිධ උපාංගවලට අන්තර්ජාලයට පිවිසීමට ඉඩ දීමයි. මෙය සාක්ෂාත් කර ගැනීම සඳහා, පුද්ගලික IP ලිපිනයක් පොදු IP ලිපිනයකට පරිවර්තනය කිරීම අවශ්‍ය වේ.

DHCP

ඩීඑච්සීපී

DHCP stands for Dynamic Host Configuration Protocol. It is an application layer protocol which is used to provide the subnet mask, the router address, the DNS address and the vendor class identifier.

සිංහලෙන්: DHCP යනු Dynamic Host Configuration Protocol යන්නයි. එය සබ්නෙට් මාස්ක්, රවුටර ලිපිනය, ඩීඑන්එස් ලිපිනය සහ වෙළෙන්දා පන්ති හඳුනාගැනීම සඳහා භාවිතා කරන යෙදුම් ස්ථර ප්‍රොටෝකෝලයකි.

The DHCP port number is 67 for the server and 68 for the client. It is a client server protocol which uses UDP services.

සිංහලෙන්: DHCP port අංකය සේවාදායකය සඳහා 67 සහ සේවාලාභියා සඳහා 68 වේ. එය UDP සේවා භාවිතා කරන සේවාදායක සේවාදායක ප්‍රොටෝකෝලයකි.

IPv6

අයිපීවී6

IPv6 was developed by the Internet Engineering Task Force to deal with the problem of IPv4 exhaustion in the future. It is a 128 bit address, having an address space of two to the power 128.

සිංහලෙන්: IPv6 අනාගතයේදී IPv4 වෙහෙසට පත්වීමේ ගැටලුව සමඟ කටයුතු කිරීම සඳහා අන්තර්ජාල ඉංජිනේරු කාර්‍ය සාධක බලකාය විසින් සංවර්ධනය කරන ලදී. එය බිට් 128 ලිපිනයක් වන අතර, 128 බලයට ලිපින අවකාශය දෙකක් ඇත.

It is not backward compatible. It is written as eight groups of hexadecimal digits separated by colons, where each group is 16 bits.

සිංහලෙන්: එය පසුගාමී නොගැලපේ. එය ලියා ඇත්තේ හෙක්සාදශම සංඛ්‍යා කාණ්ඩ අටක් ලෙසින්, එක් එක් කණ්ඩායම බිටු 16ක් වන තීරු වලින් වෙන් කර ඇත.


Keep going: ← Previous chapter · Next chapter → · Networking stage in the Self Guide