4–4
Using the TCP/IP Features
RabbitCore RCM2200
leaves 256 - 3 = 253 available IP addresses for the
example given.
4.4
How IP Addresses are Used
The actual hardware connection via an Ethernet
uses Ethernet adapter addresses (also called MAC
addresses.) These are 48-bit addresses and are
unique for every Ethernet adapter manufactured. In
order to send a packet to another computer, given
the IP address of the other computer, it is first deter-
mined if the packet needs to be sent directly to the
other computer or to the gateway. In either case,
there is an IP address on the local network to which
the packet must be sent. A table is maintained to
allow the protocol driver to determine the MAC
address corresponding to a particular IP address. If
the table is empty, the MAC address is determined
by sending an Ethernet broadcast packet to all
devices on the local network asking the device with
the desired IP address to answer with its MAC
address. In this way, the table entry can be filled in.
If no device answers, then the device is nonexistent
or inoperative, and the packet cannot be sent.
IP addresses are arbitrary and can be allocated as
desired provided that they don’t conflict with other
IP addresses. However, if they are to be used with
the Internet, then they must be numbers that are
assigned to your connection by proper authorities,
generally by delegation via your service provider.
4.5
Dynamically Assigned
Internet Addresses
In many instances, IP addresses are assigned tempo-
rarily. This the normal procedure when you use a
dial-up Internet service provider (ISP). Your system
will be provided with an IP address that it can use to
send and receive packets. This IP address will only
be valid for the duration of the call, and further may
not actually be a real Internet IP address. Such an
address works for browsing the Web, but cannot be
used for transactions originating elsewhere since no
other system has any way to know the Internet
address except by first receiving a packet from you.
(If you want to find the IP address assigned by a
dial-up ISP, run the program
winipcfg
while con-
nected and look at the address for the ppp adapter
under Windows 98.)
In a typical corporate network that is isolated from
the Internet by a firewall and/or proxy server using
address translation, the IP addresses are not usually
actual Internet addresses and may be assigned stati-
cally or dynamically. If they are assigned statically,
you only have to get an unused IP address and
assign it to the RCM2200 board. If the IP addresses
are assigned dynamically, they you will have to get
an IP address that is valid but outside of the range of
IP addresses that are assigned dynamically. This
will enable you to communicate from a PC on the
network to the RCM2200 board. If you want to
communicate to the RCM2200 board from the
external Internet, then an actual Internet IP address
must be assigned to the RCM2200 board. It may be
possible to setup the firewall to pass a real IP
address, or it may be necessary to connect the
RCM2200 board in front of the firewall to accom-
plish this.
4.6
How to Set IP Addresses in
the Sample Programs
Most of the sample programs such as shown in the
example below use macros to define the IP address
assigned to the board and the IP address of the gate-
way, if there is a gateway.
#define MY_IP_ADDRESS
"216.112.116.155"
#define MY_NETMASK
"255.255.255.248"
#define MY_GATEWAY
"216.112.116.153"
In order to do a direct connection the following IP
addresses can be used for the RCM2200 board:
#define MY_IP_ADDRESS "10.1.1.2"
#define MY_NETMASK
"255.255.255.248"
// #define MY_GATEWAY
"216.112.116.153"
Содержание RCM2200
Страница 1: ...RabbitCore RCM2200 C Programmable Module with Ethernet Getting Started Manual 019 0096 010501 B...
Страница 22: ...3 6 Software Installation Overview RabbitCore RCM2200...
Страница 31: ...C NONE...
Страница 34: ......