Saturday, January 26, 2008

Introduction to Borland C++ Builder

Borland C++ Builder is based on the C++ language but provides a highly developed environment for building applications. Although it looks impressive and easy, you need a (good) foundation in C++ before building such applications. The purpose of this book is to lay that foundation by learning the C++ language first. C++ is such a huge language that part of its foundation is provided to you so that you can write your applications by adding to it.

A program is made of various objects that you use to build your applications. Some of these objects have already been created and are supplied to you when using an environment such as Bcb. Although you will not see the whole functionality of these objects, you should be aware of which ones exist and how to use them. These objects are provided in files called Header Files or libraries. By default, Borland C++ Builder's libraries are located in the C:\Program Files\Borland\CBuilder folder. Those used for C++ are installed in the C:\Program Files\Borland\CBuilderX\Include. Those you will use when creating visual applications are located in the C:\Program Files\Borland\CBuilderX\Include\Vcl folder. Although you are allowed to view these files, if you open any of them, make sure you do not touch anything; even if you see a comma that does not make sense, do not correct it. A file that you will use as a foundation for your application is called a Header File, this is because, as "head", this file controls some aspects of your application. Therefore, you will place it at the "head" section of your program. When placing a particular file at the head of your program, you are said to "include" it. As headers, these files have an extension of .h The most used file in C++ is called iostream.h. This file is used to display things on the screen monitor or to get things the user types using a keyboard. To use such a file, you have to "include" it using the include keyword. Here is an example: include file.hYou must include the extension; this allows C++ to know that you are including a header file. As a rule, when including a file, you must precede the line with a # sign. Therefore, our include line would be #include file.hThere are usually two kinds of header files you will be using in your programs: those supplied to you and those that you create. You will mostly create your own files in the same folder where you create your program. There are two ways you let C++ know where a header file is located. If the file is located in the C:\Program Files\Borland\CBuilderX\Include, which means that it was supplied to you, include it as: #include If you created your own file, which means that the file is probably located in the same folder you are creating your application, include it as follows: #include "myfile.h"
C++ InstructionsComputer programming is the art of telling the computer what to do, when to do it, and how to do it. The programmer accomplishes this by giving instructions to the computer. An example of an instruction is, "Get a number from the user", or “Display a picture on the screen". The computer carries a lot of such assignments. In C++, an assignment is called a function; it is a task you ask the computer to perform to successfully render an intended result. Like any of the objects you will be using in your programs, a function has a name. The name of a function is a letter or a combination of letters and digits. To differentiate the name of a function from other objects, the name of a function is followed by parentheses. As an assignment, a function is made of a set of instructions. These instructions are listed in a group of lines called the body of the function. The body of a function starts with an opening curly bracket "{" and ends with a closing curly bracket "}"; everything in between is part of the function. Therefore, to use a function in your program, its syntax is: FunctionName() {}Actually, a function is a little more than that, but for now, this is enough for us. The most used function in C++ is called main. The main() function can take various forms, the easiest version is as follows: main() {}A C++ file is made of statements. These are sequences of actions you ask C++ to perform while the program is running. You can write such a statement on one line, or you can span more than one line. By default, when you start a new line, C++ believes that you are starting a new statement. To let C++ know when a statement ends, you write a semi-colon at the end of the line. For example, to write one statement, you could use: Here-Is-A-C++-Statement;To span more than one line, type a semi-colon only when the statement is over. Here is an example: A-Long-Statement-From-C++-That-Spans-More-Than-One-Line; Practical Learning: Introduction to FunctionsFrom what we have learned so far, change the contents of your file as follows:#include #include main(){} You can include one function inside of another. As an example, change the main() function as follows:main(){getch();} Executing ProgramsA program would not mean much unless it accomplishes the desired purpose. To examine how your development is proceeding, as a beginning programmer, you should regularly ask C++ to show you the result. The (small) program we have written is really plain English, something we can read and analyze. Unfortunately, the computer does not understand what it means; this is because the computer "speaks" its own language called the Machine Language. For the computer to understand what your program means, you need an intermediary program that can translate your English to machine language and vice versa. This program is called a compiler, and it is supplied to you. The process of executing a program is done in various steps that Borland C++ Builder can resume as one. There are three ways you can execute a program in Borland C++ Builder. To execute a program, you can press F9, you can also use the main menu where you would click Run ª Run. On the toolbar, you can also click the Run button
Practical Learning: Executing a ProgramOn the Debug toolbar, click the Run button .As you see, the program does not do much because we did not write a formal assignment To close the DOS window, press Enter on your keyboard. C++' coutAlthough it worked fine, the program we have just used lacks many things. You should make your programs easy to read and navigate. This is accomplished by writing each statement on its own line. For example, the above program can be re-written as follows: #include #include main(){ getch();}
The iostream.h library contains a special operator used to display something on the screen. cout is a class and not an operator. For now, we will call it an operator. This is done with the cout operator (pronounce "see-out"). To use this operator, type it followed by two "less than" signs "<<", the statement you want to display, and end the line with a semi-colon. An example would be: cout <<> Editor Options…) and click the General property sheet. In the Tab Stops combo box, specify the amount you want and click OK: Using indentation, the program could be written: #include #include main(){ getch();}Indentation should be incremental. That is, when a line of code appears to be a child of the previous line, the new line should be indented. The address lines we saw earlier can be written as: cout << "The White House " << "Pennsylvania Avenue";

Friday, January 25, 2008

Linux Networking

This tutorial covers TCP/IP networking and system configuration basics. Linux can support multiple network devices. The device names are numbered and begin at zero and count upwards. For example, a computer running two ethernet cards will have two devices labeled /dev/eth0 and /dev/eth1. Linux network configuration, management, monitoring and system tools are covered in this tutorial.

TCP/IP Network Configuration Files:
File: /etc/resolv.conf - host name resolver configuration file
search name-of-domain.com - Name of your domain or ISP's domain if using their name server
nameserver XXX.XXX.XXX.XXX - IP address of primary name server
nameserver XXX.XXX.XXX.XXX - IP address of secondary name server
This configures Linux so that it knows which DNS server will be resolving domain names into IP addresses. If using DHCP client, this will automatically be sent to you by the ISP and loaded into this file as part of the DHCP protocol. If using a static IP address, ask the ISP or check another machine on your network. Red Hat/Fedora GUI: /usr/sbin/system-config-network (select tab "DNS".
File: /etc/hosts - locally resolve node names to IP addresses
127.0.0.1 your-node-name.your-domain.com localhost.localdomain localhost XXX.XXX.XXX.XXX node-name
Note when adding hosts to this file, place the fully qualified name first. (It helps sendmail identify your server correctly) i.e.: XXX.XXX.XXX.XXX superserver.yolinux.com superserver This informs Linux of local systems on the network which are not handled by the DNS server. (or for all systems in your LAN if you are not using DNS or NIS) Red Hat/Fedora GUI: /usr/sbin/system-config-network (select tab "Hosts".
File: /etc/nsswitch.conf - System Databases and Name Service Switch configuration file
hosts: files dns nisplus nis This example tells Linux to first resolve a host name by looking at the local hosts file(/etc/hosts), then if the name is not found look to your DNS server as defined by /etc/resolv.conf and if not found there look to your NIS server.
In the past this file has had the following names: /etc/nsswitch.conf, /etc/svc.conf, /etc/netsvc.conf, ... depending on the distribution.
Fedora / Red Hat Network Configuration Files:
/etc/sysconfig/network
Red Hat network configuration file used by the system during the boot process.
File: /etc/sysconfig/network-scripts/ifcfg-eth0 Configuration settings for your first ethernet port (0). Your second port is eth1.
File:
/etc/modprobe.conf (kernel 2.6)
/etc/modules.conf (kernel 2.4)
(or for older systems: /etc/conf.modules) Example statement for Intel ethernet card:
alias eth0 eepro100 Modules for other devices on the system will also be listed. This tells the kernel which device driver to use if configured as a loadable module. (default for Red Hat)
Fedora / Red Hat Network GUI Configuration Tools:
The following GUI tools edit the system configuration files. There is no difference in the configuration developed with the GUI tools and that developed by editing system configuration files directly.
TCP/IP ethernet configuration:
Network configuration: /usr/sbin/system-config-network (FC-2/3) GUI shown here ---> /usr/bin/redhat-config-network (/usr/bin/neat) (RH 7.2+ FC-1)
Text console configuration tool: /usr/sbin/system-config-network-tui (Text User Interface (TUI) for Fedora Core 2/3) /usr/bin/redhat-config-network-tui (RH 9.0 - FC-1)
Text console network configuration tool. First interface only - eth0: /usr/sbin/netconfig
/usr/bin/netcfg (GUI) (last available with RH 7.1) Gnome Desktop:
Gnome Desktop Network Configuration /usr/bin/gnome-network-preferences (RH 9.0 - FC-3) Proxy configuration. Choose one of three options:
Direct internet connection
Manual proxy configuration (specify proxy and port)
Automatic proxy configuration (give URL)

Assigning an IP address:
Computers may be assiged a static IP address or assigned one dynamically.
Static IP address assignment:
Choose one of the following methods:
Command Line: /sbin/ifconfig eth0 192.168.10.12 netmask 255.255.255.0 broadcast 192.168.10.255 Network address by convention would be the lowest: 192.168.10.0 Broadcast address by convention would be the highest: 192.168.10.255 The gateway can be anything, but following convention: 192.168.10.1
Note: the highest and lowest addresses are based on the netmask. The previous example is based on a netmask of 255.255.255.0
Red Hat / Fedora GUI tools:
/usr/bin/neat Gnome GUI network administration tool. Handles all interfaces. Configure for Static IP or DHCP client. (First available with Red Hat 7.2.)
/usr/bin/netcfg (Handles all interfaces) (last available in Red Hat 7.1)
Red Hat / Fedora Console tools:
/usr/sbin/system-config-network-tui (Text User Interface)
/usr/sbin/netconfig (Only seems to work for the first network interface eth0 but not eth1,...)
Directly edit configuration files/scripts. See format below.
The ifconfig command does NOT store this information permanently. Upon reboot this information is lost. (Manually add the commands to the end of the file /etc/rc.d/rc.local to execute them upon boot.) The commands netcfg and netconfig make permanent changes to system network configuration files located in /etc/sysconfig/network-scripts/, so that this information is retained.
The IANA has allocated IP addresses in the range of 192.168.0.0 to 192.168.255.255 for private networks.
Helpful tools:
Network Calculators: Subnet mask calculator, node calculator, mask inverter, ...
IP subnet calculator
Ubuntu / Debian IP Configuration Files:
File: /etc/network/interfaces
Static IP example:
auto loiface lo inet loopbackauto eth0iface eth0 inet static address 208.88.34.106 netmask 255.255.255.248 broadcast 208.88.34.111 network 208.88.34.104 gateway 208.88.34.110
Dynamic IP (DHCP) example:
auto loiface lo inet loopbackauto eth0iface eth0 inet dhcpauto eth1iface eth1 inet dhcpauto eth2iface eth2 inet dhcpauto ath0iface ath0 inet dhcpauto wlan0iface wlan0 inet dhcpInterfaces:
lo: Loopback interface (network within your system without slowing down for the real ethernet based network)
eth0: First ethernet interface card
wlan0: First wireless network interface
Also see "man interfaces"
Red Hat / Fedora Core IP Configuration Files:
The Red Hat configuration tools store the configuration information in the file /etc/sysconfig/network. They will also allow one to configure routing information.
File: /etc/sysconfig/network
Static IP address Configuration: (Configure gateway address)
NETWORKING=yesHOSTNAME=my-hostname - Hostname is defined here and by command hostname
FORWARD_IPV4=true - True for NAT firewall gateways and linux routers. False for everyone else - desktops and servers.
GATEWAY="XXX.XXX.XXX.YYY" - Used if your network is connected to another network or the internet. Static IP configuration. Gateway not defined here for DHCP client.
OR for DHCP client configuration:
NETWORKING=yesHOSTNAME=my-hostname - Hostname is defined here and by command hostname
(Gateway is assigned by DHCP server.) OR for NIS client configuration:
NETWORKING=yesHOSTNAME=my-hostname - Hostname is defined here and by command hostname
NISDOMAIN=NISProject1 - NIS domain to attach
File (Red Hat/Fedora): /etc/sysconfig/network-scripts/ifcfg-eth0 (S.u.s.e.: /etc/sysconfig/network/ifcfg-eth-id-XX:XX:XX:XX:XX) This file used by the command scripts ifup and ifdown
Static IP address configuration:
DEVICE=eth0BOOTPROTO=staticBROADCAST=XXX.XXX.XXX.255IPADDR=XXX.XXX.XXX.XXX
NETMASK=255.255.255.0
NETWORK=XXX.XXX.XXX.0
ONBOOT=yes - Will activate upon system boot
RHEL4/FC3 additions:
TYPE=Ethernet
HWADDR=XX:XX:XX:XX:XX:XX
GATEWAY=XXX.XXX.XXX.XXX
OR for DHCP client configuration:
DEVICE=eth0ONBOOT=yesBOOTPROTO=dhcpRHEL4/FC3 additions:
IPV6INIT=no
USERCTL=no
PEERDNS=yes
TYPE=Ethernet
HWADDR=XX:XX:XX:XX:XX:XX (Used by script /etc/sysconfig/network-scripts/ifup to bring the various network interfaces on-line) To disable DHCP change BOOTPROTO=dhcp to BOOTPROTO=none
In order for updated information in any of these files to take effect, one must issue the command: service network restart (or: /etc/init.d/network restart)
Changing the host name:
This is a three step process:
Issue the command: hostname new-host-name
Change network configuration file: /etc/sysconfig/network Edit entry: HOSTNAME=new-host-name
Restart systems which relied on the hostname (or reboot):
Restart network services: service network restart (or: /etc/init.d/network restart)
Restart desktop:
Bring down system to console mode: init 3
Bring up X-Windows: init 5 One may also want to check the file /etc/hosts for an entry using the system name which allows the system to be self aware.
The hostname may be changed at runtime using the command: sysctl -w kernel.hostname="superserver"

Network IP aliasing:
Assign more than one IP address to one ethernet card: ifconfig eth0 XXX.XXX.XXX.XXX netmask 255.255.255.0 broadcast XXX.XXX.XXX.255 ifconfig eth0:0 192.168.10.12 netmask 255.255.255.0 broadcast 192.168.10.255 ifconfig eth0:1 192.168.10.14 netmask 255.255.255.0 broadcast 192.168.10.255 route add -host XXX.XXX.XXX.XXX dev eth0 route add -host 192.168.10.12 dev eth0 route add -host 192.168.10.14 dev eth0In this example 0 and 1 are aliases in addition to the regular eth0. The result of the ifconfig command: eth0 Link encap:Ethernet HWaddr 00:10:4C:25:7A:3F inet addr:XXX.XXX.XXX.XXX Bcast:XXX.XXX.XXX.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:14218 errors:0 dropped:0 overruns:0 frame:0 TX packets:1362 errors:0 dropped:0 overruns:0 carrier:0 collisions:1 txqueuelen:100 Interrupt:5 Base address:0xe400 eth0:0 Link encap:Ethernet HWaddr 00:10:4C:25:7A:3F inet addr:192.168.10.12 Bcast:192.168.10.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:5 Base address:0xe400 eth0:1 Link encap:Ethernet HWaddr 00:10:4C:25:7A:3F inet addr:192.168.10.14 Bcast:192.168.10.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:5 Base address:0xe400
Config file: /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0:0ONBOOT=yesBOOTPROTO=staticBROADCAST=192.168.10.255IPADDR=192.168.10.12NETMASK=255.255.255.0NETWORK=192.168.10.0ONBOOT=yesAliases can also be shut down independently. i.e.: ifdown eth0:0
The option during kernel compile is: CONFIG_IP_ALIAS=y (Enabled by default in Redhat)
Note: The Apache web server can be configured so that different IP addresses can be assigned to specific domains being hosted. See Apache configuration and "configuring an IP based virtual host" in the YoLinux Web site configuration tutorial.
DHCP Linux Client: get connection info: /sbin/pump -i eth0 --status (Red Hat Linux 7.1 and older)
Device eth0 IP: 4.XXX.XXX.XXX Netmask: 255.255.252.0 Broadcast: 4.XXX.XXX.255 Network: 4.XXX.XXX.0 Boot server 131.XXX.XXX.4 Next server 0.0.0.0 Gateway: 4.XXX.XXX.1 Domain: vz.dsl.genuity.net Nameservers: 4.XXX.XXX.1 4.XXX.XXX.2 4.XXX.XXX.3 Renewal time: Sat Aug 11 08:28:55 2001 Expiration time: Sat Aug 11 11:28:55 2001

Activating and De-Activating your NIC:
Commands for starting and stopping TCP/IP network services on an interface:
Activate: /sbin/ifup eth0 (Also: ifconfig eth0 up - Note: Even if no IP address is assigned you can listen.)
De-Activate: /sbin/ifdown eth0 (Also: ifconfig eth0 down) These scripts use the scripts and NIC config files in /etc/sysconfig/network-scripts/
GUI Interface control/configuration:
Start/Stop network interfaces /usr/bin/system-control-network (Fedora Core 2/3) /usr/bin/redhat-control-network (RH 9.0 - FC-1)
Configure Ethernet, ISDN, modem, token Ring, Wireless or DSL network connection: /usr/sbin/system-config-network-druid (FC2/3) /usr/sbin/redhat-config-network-druid (RH 9 - FC-1)
Example 192=128+64
Some addresses are reserved and outside this scope. Loopback (127.0.0.1), reserved class C 192.168.XXX.XXX, reserved class B 172.31.XXX.XXX and reserved class A 10.XXX.XXX.XXX.
Subnet Example:
Your ISP assigns you a subnet mask of 255.255.255.248 for your office.
208.88.34.104 Network Base address
208.88.34.105 Computer 1
208.88.34.106 Computer 2
208.88.34.107 Computer 3
208.88.34.108 Computer 4
208.88.34.109 Computer 5
208.88.34.110 DSL router/Gateway
208.88.34.111 Broadcast address Of the eight addresses, there are six assigned to hardware systems and ultimately only five usable addresses.
Links:
Subnet Cheat Sheet
Subnet calculator
Table of subnets
IP Subnetting, Variable Subnetting, and CIDR (Supernetting)
CISCO.com: Subnet Masking and Addressing

Network Classes:
The concept of network classes is a little obsolete as subnets are now used to define smaller networks. These subnets may be part of a class A, B, C, etc network. For historical reference the network classes are defined as follows:
Class A: Defined by the first 8 bits with a range of 0 - 127. First number (8 bits) is defined by Internic i.e. 77.XXX.XXX.XXX One class A network can define 16,777,214 hosts. Range: 0.0.0.0 - 127.255.255.255
Class B: Defined by the first 8 bits with a range from 128 - 191 First two numbers (16 bits) are defined by Internic i.e. 182.56.XXX.XXX One class B network can define 65,534 hosts. Range: 128.0.0.0 - 191.255.255.255
Class C: Defined by the first 8 bits with a range from 192 - 223 First three numbers (24 bits) are defined by Internic i.e. 220.56.222.XXX One class B network can define 254 hosts. Range: 192.0.0.0 - 223.255.255.255
Class D: Defined by the first 8 bits with a range from 224 - 239 This is reserved for multicast networks (RFC988) Range: 224.0.0.0 - 239.255.255.255
Class E: Defined by the first 8 bits with a range from 240 - 255 This is reserved for experimental use. Range: 240.0.0.0 - 247.255.255.255

Enable Forwarding:Forwarding allows the network packets on one network interface (i.e. eth0) to be forwarded to another network interface (i.e. eth1). This will allow the Linux computer to conect ("ethernet bridge") or route network traffic.
The bridge configuration will merge two (or several) networks into one single network topology. IpTables firewall rules can be used to filter traffic.
A router configuration can support multicast and basic IP routing using the "route" command. IP masquerading (NAT) can be used to connect private local area networks (LAN) to the internet or load balance servers.
Turn on IP forwarding to allow Linux computer to act as a gateway or router. echo 1 > /proc/sys/net/ipv4/ip_forward Default is 0. One can add firewall rules by using ipchains.
Another method is to alter the Linux kernel config file: /etc/sysctl.conf Set the following value:
net.ipv4.ip_forward = 1
See file /etc/sysconfig/network for storing this configuration.
FORWARD_IPV4=true Change the default "false" to "true".
All methods will result in a proc file value of "1". Test: cat /proc/sys/net/ipv4/ip_forward
The TCP Man page - Linux Programmer's Manual and /usr/src/linux/Documentation/proc.txt (Kernel 2.2 RH 7.0-) cover /proc/sys/net/ipv4/* file descriptions.
Alos see: (YoLinux tutorials)
Configure Linux as an internet gateway router: Using Linux and iptables/ipchains to set up an internet gateway for home or office (iptables)
Load balancing servers using LVS (Linux Virtual Server) (ipvsadm)

Adding a network interface card (NIC):
Manual method: This does not alter the permanent configuration and will only configure support until the next reboot.
cd /lib/modules/2.2.5-15/net/ - Use kernel version for your system. This example uses 2.2.5-15 (Fedora Core 3: /lib/modules/2.6.12-1.1381_FC3/kernel/net/) Here you will find the modules supported by your system. It can be permanently added to:
/etc/modprobe.conf (kernel 2.6)
/etc/modules.conf (kernel 2.4)
(or for older systems: /etc/conf.modules) Example: alias eth0 3c59x
/sbin/insmod 3c59x (For a 3Com ethernet card) This inserts the specified module into the kernel.
/sbin/modprobe 3c59x This also loads a module into the system kernel. Modprobe command line options:
-r : to unload the module.
/sbin/modprobe -l \* : list all modules.
/sbin/modprobe -lt net \* : List only network modules
/sbin/modprobe -t net \* : Try loading all network modules and see what sticks. (act of desperation)
ifconfig ...
The easy way: Red Hat versions 6.2 and later, ship with Kudzu, a device detection program which runs during system initialization. (/etc/rc.d/init.d/kudzu) This can detect a newly installed NIC and load the appropriate driver. Then use /usr/sbin/netconfig to configure the IP address and network settings. The configuration will be stored so that it will be utilized upon system boot.
Systems with two NIC cards: Typically two cards are used when connecting to two networks. In this case the device must be defined using one of three methods:
Use the Red Hat GUI tool /usr/bin/netcfg
OR
Define network parameters in configuration files:
Define new device in file (Red Hat/Fedora) /etc/sysconfig/network-scripts/ifcfg-eth1 (S.u.s.e 9.2: /etc/sysconfig/network/ifcfg-eth-id-XX:XX:XX:XX:XX)
DEVICE=eth1BOOTPROTO=staticIPADDR=192.168.10.12NETMASK=255.255.255.0GATEWAY=XXX.XXX.XXX.XXX
HOSTNAME=node-name.name-of-domain.com
DOMAIN=name-of-domain.com
Special routing information may be specified, if necessary, in the file (Red Hat/Fedora): /etc/sysconfig/static-routes (S.u.s.e. 9.2: /etc/sysconfig/network/routes)
Example:
eth1 net XXX.XXX.XXX.0 netmask 255.255.255.0 gw XXX.XXX.XXX.XXX
OR
Define network parameters using Unix command line interface:
Define IP address: ifconfig eth0 XXX.XXX.XXX.XXX netmask 255.255.255.0 broadcast XXX.XXX.XXX.255 ifconfig eth1 192.168.10.12 netmask 255.255.255.0 broadcast 192.168.10.255
If necessary, define route with with the route command: Examples: route add default gw XXX.XXX.XXX.XXX dev eth0 route add -net XXX.XXX.XXX.0 netmask 255.255.255.0 gw XXX.XXX.XXX.XXX dev eth0 Where XXX.XXX.XXX.XXX is the gateway to the internet as defined by your ISP or network operator.
If a mistake is made just repeat the route command substituting "del" in place of "add".
Configuring your NIC: Speed and Duplex settings:
This is usually not necessary because most ethernet adapters can auto-negotiate link speed and duplex setting.
List NIC speed and configuration: mii-tool eth0: negotiated 100baseTx-FD flow-control, link ok
Verbose mode: mii-tool -v
eth0: negotiated 100baseTx-FD flow-control, link ok product info: Intel 82555 rev 4 basic mode: autonegotiation enabled basic status: autonegotiation complete, link ok capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
Set NIC configuration: mii-tool -F option
Option
Parameters
-F
100baseTx-FD100baseTx-HD10baseT-FD10baseT-HD
-A
100baseT4100baseTx-FD100baseTx-HD10baseT-FD10baseT-HD
Query NIC with ethtool:
Command
Description
ethtool -g eth0
Queries ethernet device for rx/tx ring parameter information.
ethtool -a eth0
Queries ethernet device for pause parameter information.
ethtool -c eth0
Queries ethernet device for coalescing information.
ethtool -i eth0
Queries ethernet device for associated driver information.
ethtool -d eth0
Prints a register dump for the specified ethernet device.
ethtool -k eth0
Queries ethernet device for offload information.
ethtool -S eth0
Queries ethernet device for NIC and driver statistics.
Man Pages:
mii-tool - view, manipulate media-independent interface status
ethtool - Display or change ethernet card settings
Route:
Static routes: IP (Internet Protocol) uses a routing table to determine where packets should be sent. First the packet is examined to see if its' destination is for the local or remote network. If it is to be sent to a remote network, the routing table is consulted to determine the path. If there is no information in the routing table then the packet is sent to the default gateway. Static routes are set with the route command and with the configuration file (Red Hat/Fedora): /etc/sysconfig/network-scripts/route-eth0 or (Red Hat 7: /etc/sysconfig/static-routes) (S.u.s.e. 9.2: /etc/sysconfig/network/routes):
10.2.3.0/16 via 192.168.10.254See command: /etc/sysconfig/network-scripts/ifup-routes eth0
Dynamic routes: RIP (Routing Information Protocol) is used to define dynamic routes. If multiple routes are possible, RIP will choose the shortest route. (Fewest hops between routers not physical distance.) Routers use RIP to broadcast the routing table over UDP port 520. The routers would then add new or improved routes to their routing tables.
Man pages:
route - show / manipulate the IP routing table (Static route) Examples:
Show routing table: route -e
Access individual computer host specified via network interface card eth1: route add -host 123.213.221.231 eth1
Access ISP network identified by the network address and netmask using network interface card eth0: route add -net 10.13.21.0 netmask 255.255.255.0 gw 192.168.10.254 eth0 Conversly: route del -net 10.13.21.0 netmask 255.255.255.0 gw 192.168.10.254 eth0
Specify default gateway to use to access remote network via network interface card eth0: route add default gw 201.51.31.1 eth0 (Gateway can also be defined in /etc/sysconfig/network)
Specify two gateways for two network destinations: (i.e. one external, one internal private network. Two routers/gateways will be specified.) Add internet gateway as before: route add default gw 201.51.31.1 eth0 Add second private network: route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.10.254 eth0
routed - network routing daemon. Uses RIP protocol to update routing table.
ipx_route - show / manipulate the IPX routing table - IPX is the Novell networking protocol (Not typically used unless your office has Novell servers)
ifuser - Identify destinations routed to a particular network interface.
VPN, Tunneling:
Commercial VPN Linux software solutions - YoLinux
OpenVPN - SSL VPN solution for site to site, WiFi security, and enterprise-scale remote access with load balancing, failover, and fine-grained access-controls.
CIPE: Crypto IP Encapsulation (Easiest way to configure two Linux gateways connecting two private networks over the internet with encryption.)
CIPE Home page - CIPE is a simple encapsulation system that securely connects two subnets.
The Linux Cipe+Masquerading mini-HOWTO - Anthony Ciaravalo
Freeswan IPSec - An IPSec project for Linux (known as Freeswan and KLIPS).
GRE Tunneling - Hugo Samayoa
VPN HowTo - Matthew D. Wilson
Linux VPN support - PPTP, L2TP, ppp over SSH tunnel, VPN support working with 128-bit rc4 encryption. By Michael Elkins
Installing and Running PPTP on Linux
L2TP Extensions (l2tpext) Internet Drafts.
Description of the CISCO VPN at Cal Tech - Supports Linux (kernel 2.2), Solaris, MS/Windows 95/98/ME/NT/2000, Mac OS X/7.6-9.x

Usefull Linux networking commands:
/etc/rc.d/init.d/network start - command to start, restart or stop the network
netstat - Display connections, routing tables, stats etc
List externally connected processes: netstat -punta
List all connected processes: netstat -nap
Show network statistics: netstat -s
Kernel interface table info: netstat -a -i eth0
ping - send ICMP ECHO_REQUEST packets to network hosts. Use Cntl-C to stop ping.
traceroute - print the route packets take to network host
traceroute IP-address-of-server
traceroute domain-name-of-server
mtr - a network diagnostic tool introduced in Fedora - Like traceroute except it gives more network quality and network diagnostic info. Leave running to get real time stats. Reports best and worst round trip times in milliseconds.
mtr IP-address-of-server
mtr domain-name-of-server
whois - Lookup a domain name in the internic whois database.
finger - Display information on a system user. i.e. finger user@host Uses $HOME/.plan and $HOME/.project user files. Often used by game developers. See http://finger.planetquake.com/
iptables - IP firewall administration (Linux kernel 2.6/2.4) See YoLinux firewall/gateway configuration.
ipchains - IP firewall administration (Linux kernel 2.2) See YoLinux firewall/gateway configuration.
socklist - Display list of open sockets, type, port, process id and the name of the process. Kill with fuser or kill.
host - Give a host name and the command will return IP address. Unlike nslookup, the host command will use both /etc/hosts as well as DNS. Example: host domain-name-of-server
nslookup - Give a host name and the command will return IP address. Also see Testing your DNS (YoLinux Tutorial) Note that nslookup does not use the /etc/hosts file.
inetd/xinetd: Network Socket Listener Daemons:
The network listening daemons listen and respond to all network socket connections made on the TCP/IP ports assigned to it. The ports are defined by the file /etc/services. When a connection is made, the listener will attempt to invoke the assigned program and pipe the data to it. This simplified matters by allowing the assigned program to read from stdin instead of making its own sockets connection. The listener hadles the network socket connection. Two network listening and management daemons have been used in Red Hat Linux distributions:
inetd: Red Hat 6.x and older
xinetd: Red Hat 7.0-9.0, Fedora Core
inetd:
Configuration file: /etc/inetd.conf Entries in this file consist of a single line made up of the following fields: service socket-type protocol wait user server cmdline
service: The name assigned to the service. Matches the name given in the file /etc/services
socket-type:
stream: connection protocols (TCP)
dgram: datagram protocols (UDP)
raw
rdm
seqpacket
protocol: Transport protocol name which matches a name in the file /etc/protocols. i.e. udp, icmp, tcp, rpc/udp, rpc/tcp, ip, ipv6
wait: Applies only to datagram protocols (UDP).
wait[.max]: One server for the specified port at any time (RPC)
nowait[.max]: Continue to listen and launch new services if a new connection is made. (multi-threaded) Max refers to the maximum number of server instances spawned in 60 seconds. (default=40)
user[.group]: login id of the user the process is executed under. Often nobody, root or a special restricted id for that service.
server: Full path name of the server program to be executed.
cmdline: Command line to be passed to the server. This includes argument 0 (argv[0]), that is the command name. This field is empty for internal services. Example of internal TCP services: echo, discard, chargen (character generator), daytime (human readable time), and time (machine readable time). (see RFC)
Sample File: /etc/inetd.conf
#echo stream tcp nowait root internal#echo dgram udp wait root internalftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a#pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d#swat stream tcp nowait.400 root /usr/sbin/swat swatA line may be commented out by using a '#' as the first character in the line. This will turn the service off. The maximum length of a line is 1022 characters.
The inet daemon must be restarted to pick up the changes made to the file: /etc/rc.d/init.d/inetd restart
For more information see the man pages "inetd" and "inetd.conf".

Network Definitions:
IPv4: Most of the Internet servers and personal computers use Internet Protocol version 4 (IPv4). This uses 32 bits to assign a network address as defined by the four octets of an IP address up to 255.255.255.255. Which is the representation of four 8 bit numbers thus totaling 32 bits.
IPv6: Internet Protocol version 6 (IPv6) uses a 128 bit address and thus billions and billions of potential addresses. The protocol has also been upgraded to include new quality of service features and security. Currently Linux supports IPv6 but IPv4 is used when connecting your computer to the internet.
TCP/IP: (Transmission Control Protocol/Internet Protocol) uses a client - server model for communications. The protocol defines the data packets transmitted (packet header, data section), data integrity verification (error detection bytes), connection and acknowledgement protocol, and re-transmission.
TCP/IP time to live (TTL): This is a counting mechanism to determine how long a packet is valid before it reaches its destination. Each time a TCP/IP packet passes through a router it will decrement its TTL count. When the count reaches zero the packet is dropped by the router. This ensures that errant routing and looping aimless packets will not flood the network.
MAC Address: (media access control) is the network card address used for communication between other network devices on the subnet. This info is not routable. The ARP table maps TCP/IP address (global internet) to the local hardware on the local network. Use the command /sbin/ifconfig to view both the IP address and the MAC address. The MAC address uniquely identifies each node of a network and is used by the Ethernet protocol.
Full Duplex: Allows the simultaneous sending and receiving of packets. Most modern modems support full duplex.
Half Duplex: Allows the sending and receiving of packets in one direction at a time only.
OSI 7 Layer Model: The ISO (International Standards Organization) has defined the OSI (Open Systems Interconnection) model for current networking protocols.
OSI Layer
Description
Linux Networking Use 7
Application Layer.The top layer for communications applications like email and the web.
telnet, web browser, sendmail 6
Presentation Layer.Syntax and format of data transfer.
SMTP, http 5
Session Layer. 4
Transport Layer.Connection, acknowledgement and data packet transmission.
TCPUDP 3
Network Layer.
IPARP 2
Data Link Layer.Error control, timing
Ethernet 1
Physical Layer.Electrical characteristics of signal and NIC
Ethernet
Network Hub: Hardware to connect network devices together. The devices will all be on the same network and/or subnet. All network traffic is shared and can be sniffed by any other node connected to the same hub.
Network Switch: Like a hub but creates a private link between any two connected nodes when a network connection is established. This reduces the amount of network collisions and thus improves speed. Broadcast messages are still sent to all nodes.

Wednesday, January 23, 2008

VBScript

VBScript (short for Visual Basic Scripting Edition) is an Active Scripting language developed by Microsoft. The language's syntax reflects its pedigree as a limited variation of Microsoft's Visual Basic programming language. VBScript is installed as default in every desktop release of the Windows Operating System (OS) since Windows 98,
and may or may not be included with Windows CE depending on the configuration and purpose of the device it is running on. It initially gained support from Windows administrators seeking an automation tool more powerful than the batch language first developed in the late 1970s. A VBScript script must be executed within a host environment, of which there are several provided on a standard install of Microsoft Windows (Windows Script Host, Windows Internet Explorer). Additionally, The VBScript hosting environment is embeddable in other programs, through technologies such as the Microsoft Script control (msscript.ocx).

History
VBScript began as part of the Microsoft Windows Script Technologies, which were targeted at web developers initially and were launched in 1996. Over a period a little over two years, the VBScript and JScript languages advanced from version 1.0 to 5.0 and over that time system administrators noticed it and began using it. In 5.0, VBScript received a large boost of power with new functionality such as Regular Expressions, Classes, the With statement, Eval/Execute/ExecuteGlobal functions to evaluate and execute script commands built during the execution of another script, a function-pointer system via GetRef(), and Distributed COM (DCOM) support.
In 5.5, "Submatches" were added to the regular expression class in VBScript to finally allow VBScript script authors to capture the text within the expression's groups. That capability before was only possible through the JScript member of the Microsoft ActiveX Scripting family.
As of 2007, no new functionality will be added to the VBScript language. However, it will continue to be shipped with future releases of Microsoft Windows as will other components of the ActiveX Scripting Family (such as JScript). Additionally, support will continue due to the amount of code written in it and because it is still considered a useful tool for some tasks.
The language engine is currently being maintained by Microsoft's Sustaining Engineering Team, which is responsible for bug fixes and security enhancements.

Uses
When employed in Microsoft Internet Explorer, VBScript is similar in function to JavaScript, as a language to write functions that are embedded in or included from HTML pages and interact with the Document Object Model (DOM) of the page, to perform tasks not possible in HTML alone. Other web browsers such as Firefox, and Opera do not have built-in support for VBScript. This means that where client-side script is required on a web site, developers almost always use JavaScript for cross-browser compatibility.
Besides client-side web development, VBScript is used for server-side processing of web pages, most notably with Microsoft Active Server Pages (ASP). The ASP engine and type library, asp.dll, invokes vbscript.dll to run VBScript scripts. VBScript that is embedded in an ASP page is contained within and context switches. The following example of an ASP page with VBScript displays the current time in military format (Note that an = sign occurring after a context switch (

Tuesday, January 22, 2008

Cellular Telecommunications

articles and information on cellular telecommunication / cell phone technology
There are many mobile or cell phone systems that are in use all over the world and there is a considerable amount of equipment ranging from the cell phones themselves to cellular base stations, antennas and the network infrastructure.
In addition to the basic equipment there is new cell phone technology to provide the many new services that are now available, enabling cell phone users to enjoy many new applications from games, and ringtone downloads to picture and video downloads. With technologies ranging from GSM, GPRS, EDGE to UMTS or W-CDMA and cdmaOne (IS-95) to CDMA2000 1X, EV-DO and EV-DV and mobile TV technologies such as MediaFLO, DMB, and DVB-H, there are plenty of technologies in use.
There is plenty of terminology associated with cellular telecommunications and cell phone technology. Our terminology glossary explains the most commonly used terms associated with cellular telecommunications / cell phone technology:
The technology behind cellular systems and cell phones has developed from the first generation (1G) systems to the second geenration (2G) systems and then to the third generation (3G) systems. At each stage the performance improved and further facilities were available, from SMS messaging to video downloads.
- Major Mobile Phone Systems (a tabular overview)
- The Route from Analogue to 3G
Cellular telecommunications basics.
There are a number of basic concepts behind cellular telecommunications systems. These include the idea of cells themselves as well as how the networks are set up, what is in a mobile phone and how some of the transmission technologies such as CDMA, TDMA and the like operate.
- The basic concept of a cellular telecommunications system
- The multiple access schemes used by mobile phones
- The duplex schemes used by mobile phone networks - FDD and TDD
- The operation and electronics within a mobile phone
- The basics of a cellular network
- The way in which a mobile phone registers onto a network
- Handover or handoff, the way in which cellular calls are transferred from one cell to another
- Code Division Multiple Access (CDMA) What it is and how it works
- Orthogonal Frequency Division Multiplex (OFDM) What it is and how it works
- MIMO - Multiple Input Multiple Output What it is and how it works
Cellular testing

Universal Mobile Telecommunication System

1. 3G Systems
2. UMTS Services
3. UMTS Architecture
4. Core Network
5. Radio Access
6. User Equipment

1. 3G Systems
3G Systems are intended to provide a global mobility with wide range of services including telephony, paging, messaging, Internet and broadband data. International Telecommunication Union (ITU) started the process of defining the standard for third generation systems, referred to as International Mobile Telecommunications 2000 (IMT-2000).

In Europe European Telecommunications Standards Institute (ETSI) was responsible of UMTS standardisation process. In 1998 Third Generation Partnership Project (3GPP) was formed to continue the technical specification work. 3GPP has five main UMTS standardisation areas: Radio Access Network, Core Network, Terminals, Services and System Aspects and GERAN.
3GPP Radio Access group is responsible of:
Radio Layer 1, 2 and 3 RR specification Iub, Iur and Iu Interfaces UTRAN Operation and Maintenance requirements BTS radio performance specification Conformance test specification for testing of radio aspects of base stations Specifications for radio performance aspects from the system point of view
3GPP Core Network group is responsible of:
Mobility management, call connection control signalling between the user equipment and the core network.
Core network signalling between the core network nodes.
Definition of interworking functions between the core network and external networks.
Packet related issues.
Core network aspects of the lu interface and Operation and Maintenance requirements
3GPP Terminal group is responsible of:
Service capability protocols
Messaging
Services end-to-end interworking
USIM to Mobile Terminal interface
Model/framework for terminal interfaces and services (application) execution
Conformance test specifications of terminals, including radio aspects
3GPP Services and System Aspects group is responsible of:
Definition of services and feature requirements.
Development of service capabilities and service architecture for cellular, fixed and cordless applications.
Charging and Accounting
Network Management and Security Aspects
Definition, evolution, and maintenance of overall architecture.
Third Generation Partnership Project 2 (3GPP) was formed for technical development of cdma2000 technology which is a member of IMT-2000 family.
In February 1992 World Radio Conference allocated frequencies for UMTS use. Frequencies 1885 - 2025 and 2110 - 2200 MHz were identified for IMT-2000 use. See the UMTS Frequency page for more details. All 3G standards are still under constant development. In 1999 ETSI Standardisation finished for UMTS Phase 1 (Release '99, version 3) and next release is due December 2001. UMTS History page has a list of all major 3G and UMTS milestones. Most of the European countries and some countries round the world have already issued UMTS licenses either by beauty contest or auctions.
2. UMTS Services
UMTS offers teleservices (like speech or SMS) and bearer services, which provide the capability for information transfer between access points. It is possible to negotiate and renegotiate the characteristics of a bearer service at session or connection establishment and during ongoing session or connection. Both connection oriented and connectionless services are offered for Point-to-Point and Point-to-Multipoint communication.
Bearer services have different QoS parameters for maximum transfer delay, delay variation and bit error rate. Offered data rate targets are:
144 kbits/s satellite and rural outdoor
384 kbits/s urban outdoor
2048 kbits/s indoor and low range outdoor
UMTS network services have different QoS classes for four types of traffic:
Conversational class (voice, video telephony, video gaming)
Streaming class (multimedia, video on demand, webcast)
Interactive class (web browsing, network gaming, database access)
Background class (email, SMS, downloading)
UMTS will also have a Virtual Home Environment (VHE). It is a concept for personal service environment portability across network boundaries and between terminals. Personal service environment means that users are consistently presented with the same personalised features, User Interface customisation and services in whatever network or terminal, wherever the user may be located. UMTS also has improved network security and location based services.
3. UMTS Architecture
A UMTS network consist of three interacting domains; Core Network (CN), UMTS Terrestrial Radio Access Network (UTRAN) and User Equipment (UE). The main function of the core network is to provide switching, routing and transit for user traffic. Core network also contains the databases and network management functions.
The basic Core Network architecture for UMTS is based on GSM network with GPRS. All equipment has to be modified for UMTS operation and services. The UTRAN provides the air interface access method for User Equipment. Base Station is referred as Node-B and control equipment for Node-B's is called Radio Network Controller (RNC). UMTS system page has an example, how UMTS network could be build.
It is necessary for a network to know the approximate location in order to be able to page user equipment. Here is the list of system areas from largest to smallest.
UMTS systems (including satellite)
Public Land Mobile Network (PLMN)
MSC/VLR or SGSN
Location Area
Routing Area (PS domain)
UTRAN Registration Area (PS domain)
Cell
Sub cell
4. Core Network
The Core Network is divided in circuit switched and packet switched domains. Some of the circuit switched elements are Mobile services Switching Centre (MSC), Visitor location register (VLR) and Gateway MSC. Packet switched elements are Serving GPRS Support Node (SGSN) and Gateway GPRS Support Node (GGSN). Some network elements, like EIR, HLR, VLR and AUC are shared by both domains.
The Asynchronous Transfer Mode (ATM) is defined for UMTS core transmission. ATM Adaptation Layer type 2 (AAL2) handles circuit switched connection and packet connection protocol AAL5 is designed for data delivery.
The architecture of the Core Network may change when new services and features are introduced. Number Portability DataBase (NPDB) will be used to enable user to change the network while keeping their old phone number. Gateway Location Register (GLR) may be used to optimise the subscriber handling between network boundaries. MSC, VLR and SGSN can merge to become a UMTS MSC.
5. Radio Access
Wide band CDMA technology was selected to for UTRAN air interface. UMTS WCDMA is a Direct Sequence CDMA system where user data is multiplied with quasi-random bits derived from WCDMA Spreading codes. In UMTS, in addition to channelisation, Codes are used for synchronisation and scrambling. WCDMA has two basic modes of operation: Frequency Division Duplex (FDD) and Time Division Duplex (TDD). UTRAN interfaces are shown on UMTS Network page.
The functions of Node-B are:
Air interface Transmission / Reception
Modulation / Demodulation
CDMA Physical Channel coding
Micro Diversity
Error Handing
Closed loop power control
The functions of RNC are:
Radio Resource Control
Admission Control
Channel Allocation
Power Control Settings
Handover Control
Macro Diversity
Ciphering
Segmentation / Reassembly
Broadcast Signalling
Open Loop Power Control
6. User Equipment
The UMTS standard does not restrict the functionality of the User Equipment in any way. Terminals work as an air interface counter part for Node-B and have many different types of identities. Most of these UMTS identity types are taken directly from GSM specifications.
International Mobile Subscriber Identity (IMSI)
Temporary Mobile Subscriber Identity (TMSI)
Packet Temporary Mobile Subscriber Identity (P-TMSI)
Temporary Logical Link Identity (TLLI)
Mobile station ISDN (MSISDN)
International Mobile Station Equipment Identity (IMEI)
International Mobile Station Equipment Identity and Software Number (IMEISV)
UMTS mobile station can operate in one of three modes of operation:
PS/CS mode of operation: The MS is attached to both the PS domain and CS domain, and the MS is capable of simultaneously operating PS services and CS services.
PS mode of operation: The MS is attached to the PS domain only and may only operate services of the PS domain. However, this does not prevent CS-like services to be offered over the PS domain (like VoIP).
CS mode of operation: The MS is attached to the CS domain only and may only operate services of the CS domain.
UMTS IC card has same physical characteristics as GSM SIM card. It has several functions:
Support of one User Service Identity Module (USIM) application (optionally more that one)
Support of one or more user profile on the USIM
Update USIM specific information over the air
Security functions
User authentication
Optional inclusion of payment methods
Optional secure downloading of new applications
--------------------------------------------------------------------------------
Other UMTS overviews in the web:
TU Wien UMTS Overview
IEC UMTS Overview
Radio interfaces

Sunday, January 20, 2008

ATM-to-the-Desktop Environment

1 Preface
This Redpaper describes experiences made during installation of an ATM to the desktop
network in a Windows NT 4.0 Server/Workstation environment. It covers the physical and logical network design, the reasons for it, the problems faced and how to solve them. It also describes the dependencies and peculiarities of a multiprotocol and/or multihomed Windows NT installation running on an ATM to the desktop emulated LAN. Hopefully this document will help to avoid any of these problems in other installations.

2 About the Author
Matthias Enders is a Networking Specialist in Germany. He has nine years of experience in the networking field. His areas of expertise include TCP/IP, campus LAN products and LAN
protocol analysis as well as multiprotocol network design and implementation. He has written extensively on the following redbooks:
M TCP/IP Tutorial and Technical Overview, fifth edition M IBM Nways RouteSwitch Implementation Guide, first edition
3 Acknowledgments
I would like to thank the following colleagues for their invaluable help and support. Marc Gerbrecht, IBM PSS Software Support, Mainz, MCSE Niels Junge, IBM PSS NSDU, Frankfurt, MCSE
4 Why ATM to the Desktop in this Installation?
About a year ago the customer moved his whole business to a new built location. With this movement he had the unique opportunity to build the whole network and PC client/server
environment almost from scratch. The whole institution was equipped with new PCs and servers. They also decided to migrate from Novell Netware to Windows NT 4.0 as network operating system for file and print services.
On the other hand they had to provide an infrastructure that met their today's requirements and as important had the potential to support their medium and long term applications. The most important requirements were:
M Support for their newly developed multimedia application. This highly sophisticated system
had to be able to deliver many different audio and video data streams simultaneously to hundreds of workstations.
M Multi protocol support for IP, IPX and DLC M The new network had to be very flexible to adapt easily to modifications of the logical structure. They had only eight NIC assigned class C networks available for the whole intranet.
M Seamless LAN/WAN integration of two remote sites also running an ATM network. One of his sites had to have access to the multimedia application as well.
M The network had to provide end to end QOS for future multimedia applications even in this
heavy subnetted IP structure where many client/server communications relied on inter subnet
connections.
M The backbone had to be very scalable since nobody was able to forecast the amount of andwidth needed to drive good quality audio and video within the whole building.
At the time the decision had to be made there were two solutions technically feasible: A fully
witched Fast Ethernet or ATM to the desktop. There were two possible networking architectures included in the customers invitation of tenders:
First, a fully switched Ethernet or second, an ATM to the desktop network. As they compared different tenders it turned out that the hardware and labor costs for both technologies were almost equal at that time. Finally they chose the ATM solution since this technology came up loser to their today’s and future requirements.
5 The Physical Network
This chapter describes the physical network topology, the network devices used, their code levels and the redundancy features.
5.1 Detailed Physical Network Topology As with most ATM networks the physical topology was very simple. The backbone consisted of two IBM 8265-17S connected via two OC-12 links. All 500 client PCs were equipped with an IBM Turboways 25 Mbit/s PCI NIC that connected to one of the 24 IBM 8285-001 ATM switches.
All IBM 8285s were at least connected to either of both backbone switches via an OC-3 link. There are 13 IBM 8285 switches that had an expansion chassis attached. These switches wereconnected to both backbone switches for link redundancy and bandwidth demands. There was also an IBM 8260-A17 with three OC-3 links to each backbone switch installed because of the high demand on 25 Mbit/s ports in that particular wiring closet.
All LAN and network services were fulfilled by two IBM 8210-001 each equipped with two ATM adapters. The legacy Ethernet attachment was done by an IBM 8271-216 and a three slot wide IBM 8271 ATM/LAN Switch blade in one of the IBM 8265’s compatibility slots. All available feature slots of the IBM 8271s carried a three port 10Base-FL UFC for concentration of all IBM 8224 hubs located in every wiring closet. These hubs were used to provide a legacy LAN attachment for network printers, the UPS management NIC and for testing purposes.
All ATM attached servers were directly connected to one of the backbone switches via an OC-3 interface. We used Olicom OC-615x adapters for all servers since they were Microsoft NT 4.0 certified. All non ATM attached servers had a dedicated Ethernet port at one of the IBM 8271s. Both remote ATM network sites were connected through the ATM network of a service provider. Therefore, one IBM 8265 held a WAN2 module with E1 ports in a compatibility slot.
5.2 Code Levels Used
V4.06 W-NT 4.0 Olicom 615x 155 Mbit/s ATM Adapter
V2.3.1 W-NT 4.0 IBM Turboways 25 Mbit/s ATM Adapter
V3.2.0 IBM 8285-001
V5.1/V1.15.0 IBM 8271-216/ATM UFC
V3.3.5 IBM 8265-17S
V3.2.0 IBM 8260-A17
V1.2.1 PTF5 IBM 8210-001
Code Level Device
5.3 Physical Network Redundancy
Both IBM 8265 and the IBM 8260 were equipped with all possible redundancy features: Redundant control points, controller modules and n+1 power supplies. All major end station concentration points (8285/8260) had at least two backbone connections. There were two IBM 8210 with a fully redundant configuration. All network devices were connected to a UPS to prevent power drops.
6 ATM Network Configuration
This chapter describes some peculiarities of the ATM switch configuration.
6.1 ATM Address Prefix
To avoid future ATM addressing conflicts, the customer requested a sub part of a registered DCC network prefix from a service provider. They got a unique 11 Bytes prefix assigned thus Bytes 12 and 13 were used to build the internal addressing scheme. They decided to use Byte 12
to indicate the PNNI peer group and Byte 13 for ATM switch addresses within a peer group.
Each location got its own peer group id in order to minimize PNNI routing traffic over the WAN
links. The headquarters peer group consisted of 27 switches. The interconnection of all three peer groups via WAN links was done by IISP.
6.2 ATM WAN Connection
The ATM network service provider offered the following services:
M Two physical PDH based E1 links, G.703
M Symmetrical VBR with PCR/SCR of 4420/2210 cps (both directions had the same cell
rates)
M Virtual path to each remote location with a maximum of 300 concurrent SVCs (VP
tunneling)
M Local VPI 14 and 15, one for each physical link and remote location respectively
We mapped these given WAN specifications to the following IBM 8265 configuration:
set port 1.1 enable void VPI_VCI: 4.8 shaping: 912
set port 1.3 enable void VPI_VCI: 4.8 shaping: 912
There is a 12 Bits VPI.VCI range supported for WAN ports. We had to spend four Bits on the
VPI range in order to support the given VPIs 14 and 15. Therefore, SVCs will be allocated in
the range 14.32...14.255. We didn’t use the VPI_OFFSET parameter to increase the possible
amount of VCIs since there was an IBM 8260 on the other side of the link that didn’t support
this parameter.
set VPC_LINK 1.1 14 enable IISP network bandwidth: 912 ILMI_VCI: NONE
set VPC_LINK 1.3 15 enable IISP network bandwidth: 912 ILMI_VCI: NONE
Set reachable_address 1.1 12 39. ... .02 VPI: 14
Set reachable_address 1.3 12 39. ... .03 VPI: 15
6.3 Calculation of the Shaping Bandwidth
Since the ATM network provider offered a VBR service but we just tunneled UBR traffic fromthe LAN emulation services through the VP, we had to make sure that the cell rate never exceeded the given VBR limits. Otherwise the provider discarded all cells that were above the limit. To meet the provider specs we used the intelligent shaping function provided on WAN ports. To avoid any cell dropping at the provider we based our bandwidth calculation on the Sustainable Cell Rate (SCR).
BW = SCR * 53 * 8 / 1024
BW = Bandwidth in kbps
SCR = Sustainable Cell Rate in cps
53 = ATM Cell length in Bytes
The entered shaping bandwidth is automatically adjusted to a multiple of 8 kbps by the IBM 8265. We defined a shaping bandwidth of 912 kbps that corresponded to the SCR of 2210 cps. We also made some tests with higher bandwidths to push the limits a little further and defined a
bandwidth that corresponded to a cell rate of 10 % below PCR. Pings with 64 Bytes did fine but larger ones didn’t come through since cells were dropped randomly by the provider. Therefore,
we decided to keep the SCR bandwidth since no cells were dropped even if the link was saturated.
6.4 PNNI Configuration
We set the VPI.VCI Bits for every PNNI port to 0.14 (the default is 4.10) since most ports had to support more than 1000 simultaneous SVCs and the PNNI implementation supports VPI=0 for SVC allocation only.
Another experience we made was the influence of ILMI on IBM Nways Campus Manager for AIX. First, we set ILMI=NONE on all PNNI ports since ILMI is not used by PNNI. Then we
ecognized that the discovery function of the ATM network topology by the IBM Nways Campus Manager relied on ILMI to draw a correct ATM network map.
We chose shortest_path for PNNI UBR path selection in order to avoid SVCs routed through redundant links of the IBM 8285. This configuration also assures the equal distribution of UBR-SVCs on parallel links between any two switches.
6.5 UNI Port Configuration
We also changed the VPI_VCI Bits on all server UNI ports since these adapters only supported
VPI=0 but up to 1000 simultaneous SVCs. Thus the default of 4.10 was not sufficient since this
setting supported 992 SVCs only (1024-32 reserved VCIs). Therefore, we changed it to 0.14.
The same change was done on all ports where an IBM 8210 was attached to. Meanwhile MSS
supports VPIs higher than 0.
7 Logical Network Topology
To find out which network topology fits best for this particular environment we did a network
assessment with the customer to clearly identify the needs, requirements and expectations. 7.1 Customer Requirements
1. Communication between NT workstations and NT servers is done via TCP/IP only
2. Routing from NT workstations to NT servers has to be avoided even if the workstations resided in different IP subnets
3. All default gateway addresses provided by the MSS have to be redundant since all clients have a static default gateway configured
4. Five of the nine IP subnets have to be available at all IBM 8224 Ethernet hubs for flexibility and testing reasons
5. Most PCs have IPX active as a second protocol
6. All IPX PCs have to reside in only one IPX network throughout the whole location in order to avoid IPX routing to a gateway
7. Many other requirements ...
7.2 ELAN Considerations
One of the first questions that came up was which ELAN design would be best?
M One simple flat ELAN
M A separate ELAN for each IP subnet
We checked both approaches and decided finally for the second alternative in conjunction with a
SuperELAN. Following are the major reasons for that:
Most client PCs were split up into three IP subnets. To avoid routing on the path to the NT server we assigned three IP addresses to it, one in each subnet (multihomed server). Since we mapped each IP subnet to a separate ELAN, the server had to have three LECs. This multiple LEC configuration is the only way to force NT servers to really use their different IP interfaces for TCP/IP NetBIOS services. It is not sufficient to configure just multiple IP addresses for one single LEC since NetBIOS’ multihoming capability relies on multiple physical (or in our case emulated) network adapters. NetBIOS is not aware of TCP/IP at all. Only true TCP/IP socket applications running on an NT server are able to differentiate between multiple IP addresses configured for one LEC.
Now one might think why not configuring multiple LECs at the NT server to a single ELAN to
achieve a simple ELAN structure? This is not always feasible since some ATM adapter drivers don’t support multiple LECs connection to one ELAN even if every LEC uses a unique MAC address. The Olicom driver we used refused to accept multiple connections to the same point to
multipoint VCC from one LES/BUS. So we had no other chance except to create one ELAN for every IP subnet. Note: Please refer to chapter 7.6 Multihoming of NT Servers for further implications when using multiple LECs on a NT server. The second reason for multiple ELANs was the requirement for an IP redundant default gateway function on every IP subnet. Our initial planning was based on MSS 1.1.1 PTF7 that supported multiple IP addresses per LEC but only one redundant default gateway address. Later after all planning and design was finished we migrated to MSS 1.2.1 where this function is supported now. Today there would be no need for multiple ELANs to achieve this particular function. After that we looked at requirements four, five and six. To meet those we had to enlarge the broadcast domain beyond ELAN borders. Requirement four means that the customer could plug an Ethernet PC or any other device configured with an IP address within these five IP subnets into any IBM 8224 hub and it should work. This functionality couldn’t be achieved with the IBM
8271 since this device supports only one LEC per domain.
We got this solved with the precious SuperELAN function of the MSS. We simply put all IBM
8271 ports in one domain and assigned the uplink LEC to one of the five ELANs which was a
member of the SuperELAN. We also achieved the fifth and sixth requirement with the SuperELAN structure since all PCs requiring IPX access resided in one of the five IP ELANs.
Thus from their IPX perspective all ELANS looked as one single segment.
Note: In MSS code prior 1.2.1 PTF5 there was a problem related to the redundant default
gateway function within a SuperELAN. When a LEC sent an LE_ARP_REQUEST to its LES
after he had resolved the MAC address of its default gateway, all MSS LEC configured for
redundant default gateway function within the same SuperELAN established an SVC to this PC.
These useless SVCs are not of a problem in a small installation but in our 400 LEC SuperELAN
environment we got up to 1600 additional unusable SVCs to the MSS. This problem was fixed
with 1.2.1 PTF5.
7.3 Broadcast Considerations in the SuperELAN Environment
After installation we monitored the broadcast traffic at an Ethernet hub in order to get some information on broadcasts within the SuperELAN since each broadcast is flooded to every device connected to the SuperELAN. In our case the broadcast rate was pretty low and the occupied bandwidth was about 1 % of 10 Mbit/s which was acceptable. The majority were IPX RIP and SAP broadcasts as we expected. We also had a closer look at the amount of IP ARP broadcasts coming from the five ELANs which build the SuperELAN. This particular broadcast rate was that low that we decided not to enable the IP Broadcast Manager (BCM) on the MSS to further reduce this kind of traffic and therefore to lose the much more important fast BUS mode operation for the ELANs.
7.4 Splitting of Functions for Load-Balancing/Redundancy
We had two IBM 8210-001 with two ATM adapters each. The network had to fully function with only one MSS active. We also didn’t want to have a simple redundancy configuration with a
primary MSS fulfilling all functions and a backup only MSS idling during normal operation. This
would be to much waste of resources. We decided for the following splitting of functions:
primary n/a backup n/a Routing
n/a backup n/a primary LES/BUS/LECS