A network address translation apparatus and method within a Voice over
Internet Protocol (VoIP) router is described. This apparatus and method
operates within networking devices such as routers, switches, bridges,
etc. These devices masks both source and destination addresses and may
either replace or complement a firewall in providing security. According
to one embodiment, network type information, corresponding to the
gateways within connection, is embedded in a port number within a packet
header. This network type information is extracted and analyzed to
identify the network types of both gateways within the connection.
According to another embodiment, a port number is assigned according to
the network types of both gateways within a connection. Thus, this
network type information may be identified by processing the port number
on which a packet is received.