Hello Guest! Welcome to ep6network, Get all components from Basic Networking.
Something you might want to know about us.
Don't be hesitated to contact us if you have something to say.

Address, Port, Pat and Nat

| | Tuesday, April 14, 2009
|

Addressing

Physical Addressing

In computing, a physical address, also real address, or binary address, is the memory address that is electronically (in the form of binary number) presented on the computer address bus circuitry in order to enable the data bus to access a particular storage cell of main memory.

In a computer with virtual memory, the term physical address is used mostly to differentiate from a virtual address. In particular, in computers utilizing memory management unit (MMU) to translate memory addresses, the virtual and physical address refer to address before and after MMU translation, respectively.

In computer networking, physical address is sometimes a synonym of MAC address. The address is actually used on network's data link layer, not on physical layer, as the name would suggest.

Note: There are two basic types of physical addresses when referencing Ethernet which are large and fixed physical addresses and proNET, which has small relatively easy to configure addresses.

Unaligned addressing

Depending upon its underlying computer architecture, the performance of a computer may be hindered by unaligned access to memory. As an example, a 16 bit computer with a 16 bit memory data bus such as an Intel 8086 generally works most efficiently if the access is aligned to an even address. In that case fetching one 16 bit value requires a single memory read operation, a single transfer over a data bus. Obviously, if the 16 bit data value starts at an odd address, the processor may actually need to perform two memory read cycles to load the value into it, i.e. one for the low address (throwing half of it away) and then a second to load the high address (again throwing half of the retrieved data away).

Sourse- Wikipedia


Logical Address

In computer architectures, a logical address is the address at which a memory location appears to reside from the perspective of an executing application program. This may be different from the physical address due to the operation of a memory management unit (MMU) between the CPU and the memory bus. Physical memory may be mapped to different logical addresses for various purposes. For example, the same physical memory may appear at two logical addresses and if accessed by the program at one address, data will pass through the processor cache whereas if it is accessed at the other address, it will bypass the cache.

In a system supporting virtual memory, there may actually not be any physical memory mapped to a logical address until an access is attempted. The access triggers special functions of the operating system which reprogram the MMU to map the address to some physical memory, perhaps writing the old contents of that memory to disk and reading back from disk what the memory should contain at the new logical address. In this case, the logical address may be referred to as a virtual address.

Sourse- Wikipedia

Port Address Translation

Port Address Translation (PAT) is a feature of a network device that translates TCP or UDP communications made between hosts on a private network and hosts on a public network. It allows a single public IP address to be used by many hosts on a private network, which is usually a Local Area Network or LAN.

A PAT device transparently modifies IP packets as they pass through it. The modifications make all the packets which it sends to the public network from the multiple hosts on the private network appear to originate from a single host, (the PAT device) on the public network.

Relationship between NAT and PAT

PAT is a subset of NAT, and is closely related to the concept of Network Address Translation. PAT is also known as NAT Overload. In PAT there is generally only one publicly exposed IP address and multiple private hosts connecting through the exposed address. Incoming packets from the public network are routed to their destinations on the private network by reference to a table held within the PAT device which keeps track of public and private port pairs.

In PAT, both the sender's private IP and port number are modified; the PAT device chooses the port numbers which will be seen by hosts on the public network. In this way, PAT operates at layer 3 (network) and 4 (transport) of the OSI model, whereas basic NAT only operates at layer 3.

Establishing Two-Way Communication

Every TCP and UDP packet contains both a source IP address and source port number as well as a destination IP address and destination port number. These four pieces of information, taken together, form a socket.

For publicly accessible services such as web servers and mail servers the port number is important. For example, port 80 connects to the web server software and port 25 to a mail server's SMTP daemon. The IP address of a public server is also important, similar in global uniqueness to a postal address or telephone number. Both IP address and port must be correctly known by all hosts wishing to successfully communicate.

Private IP addresses as described in RFC 1918 are significant only on private networks where they are used, which is also true for host ports. Ports are unique endpoints of communication on a host, so a connection through the PAT device is maintained by the combined mapping of port and IP address.

PAT resolves conflicts that would arise through two different hosts using the same source port number to establish unique connections at the same time.

An Analogy of PAT

A PAT device is similar to the receptionist at an office that has one public telephone number. Outbound phone calls made from the office all appear to come from the same telephone number. However, incoming calls have to be transferred to the correct private extension by an operator asking the caller who they'd like to speak with; private extensions cannot be dialed directly from outside.

Translation of the Endpoint

With PAT, all communication sent to external hosts actually contain the external IP address and port information of the PAT device instead of internal host IPs or port numbers.

  • When a computer on the private (internal) network sends a packet to the external network, the PAT device replaces the internal IP address in the source field of the packet header (sender's address) with the external IP address of the PAT device. It then assigns the connection a port number from a pool of available ports, inserting this port number in the source port field (much like the post office box number), and forwards the packet to the external network. The PAT device then makes an entry in a translation table containing the internal IP address, original source port, and the translated source port. Subsequent packets from the same connection are translated to the same port number.
  • The computer receiving a packet that has undergone PAT establishes a connection to the port and IP address specified in the altered packet, oblivious to the fact that the supplied address is being translated (analogous to using a post office box number).
  • A packet coming from the external network is mapped to a corresponding internal IP address and port number from the translation table, replacing the external IP address and port number in the incoming packet header (similar to the translation from post office box number to street address). The packet is then forwarded over the inside network. Otherwise, if the destination port number of the incoming packet is not found in the translation table, the packet is dropped or rejected because the PAT device doesn't know where to send it.

PAT will only translate IP addresses and ports of its internal hosts, hiding the true endpoint of an internal host on a private network.

Visibility of Operation

The PAT operation is typically transparent to both the internal and external hosts.

Typically the internal host is aware of the true IP address and TCP or UDP port of the external host. Typically the PAT device may function as the default gateway for the internal host. However the external host is only aware of the public IP address for the PAT device and the particular port being used to communicate on behalf of a specific internal host.

Uses of PAT

Software firewalls and broadband network access devices (e.g. ADSL routers) are examples of network technologies that may contain PAT implementations. When configuring these devices, the external network is the Internet and the internal network is a LAN.

Examples of PAT

A host at IP address 192.168.0.2 on the private network may ask for a connection to a remote host on the public network. The initial packet is given the address 192.168.0.2:15345. The PAT device (which we assume has a public IP of 1.2.3.4) may arbitrarily translate this source address:port pair to 1.2.3.4:16529, making an entry in its internal table that port 16529 being used for a connection by 192.168.0.2 on the private network. When a packet is received from the public network by the PAT device for address 1.2.3.4:16529 the packet is forwarded to 192.168.0.2:15345.

Advantages of PAT

In addition to the advantages provided by NAT:

  • PAT allows multiple internal hosts to share a single external IP address.

Disadvantages of PAT

  • Scalability - Many hosts on the private network make many connections to the public network. Since there are only a limited number of ports available, the PAT device may eventually have insufficient space in the translation table. While there are thousands of ports available, and they are recycled quickly, some network communications consume multiple ports nearly simultaneously in a single logical transaction (an HTTP request for a web page with many embedded objects; some VoIP applications). Sufficiently-large LANs that frequently sustain this type of traffic could periodically consume all available ports.
  • Firewall complexity - Because the inside addresses are all disguised behind one publicly-accessible address, it is impossible for outside machines to initiate a connection to a particular inside machine without special configuration on the firewall to forward connections to a particular port. This has a considerable impact upon applications such as VOIP, videoconferencing, and other peer-to-peer applications.

Sourse- Wikipedia



0 responce(s):

Post a Comment

 

Enter your email address:

Delivered by FeedBurner