TCP/IP procedures and application for the GTS Geoff Molloy Communications and Computing Branch Bureau of Meteorology Australia TCP/IP procedures and application for the GTS Agenda • • • • • • • GTS Comms Evolution Network Topologies Overview of TCP/IP GTS IP Addressing Routing Data Transfer - TCP and FTP WMO standards – Sockets and FTP TCP/IP procedures and application for the GTS GTS Comms Evolution • Asynchronous to X.25 to IP • X.25 saw the introduction of error detection and correction. • The advantages of TCP/IP include cost, simplicity and the ability to use a range of high level (application) protocols. – http (web) Remote machine logins (telnet, rlogin, remsh) FTP (File Transfer Protocol) Smtp (e-mail) remote database access TCP/IP procedures and application for the GTS 7, Office V V _V 7,rnet w ce netwall Cabinet-1 Network Topology GTS Private or Public Addresses Firewall Regional Offices Internet Head Office Public Addresses WEB FTP Message Switch TCP/IP procedures and application for the GTS IP Address format TCP/IP procedures and application for the GTS . IP Address format (cont.) Class A Class B Class C Class D Class E 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 --+-------------+-----------------------------------------------|0| NET_ID | HOST_ID | |-+-+-----------+---------------+-------------------------------| |1|0| NET_ID | HOST_ID | |-+-+-+-------------------------+---------------+---------------| |1|1|0| NET_ID | HOST_ID | |-+-+-+-+---------------------------------------+---------------| |1|1|1|0| MULTICAST_ID | |-+-+-+-+-------------------------------------------------------| |1|1|1|1| EXPERIMENTAL_ID | --+-+-+-+-------------------------------------------------------- FIGURE 5. IP Address Format. TCP/IP procedures and application for the GTS IP Addresses • Must have public addresses for inter-agency communications. • Private addresses may be used within your organisation. • Network Address Translation (NAT) is used to convert between private and public addresses • WMO allocates public addresses for GTS: possible allocation for hosts, but cannot be used for Internet connection. TCP/IP procedures and application for the GTS IP addresses (cont.) • GTS Allocation: 193.105.177.0 to 193.105.184.0 • Private address allocations: – 10.0.0.0 to 10.255.255.255 – 172.16.0.0 to 172.16.255.255 – 192.168.0.0 to 192.168.255.255 • Subnet Mask: 2 ways to refer top this – 192.168.1.1 255.255.255.0 – 192.168.1.1/24 • /24 = 11111111 11111111 11111111 00000000 TCP/IP procedures and application for the GTS IP addresses (cont.) • Get IP address from ISP • Possibly get IP address from WMO TCP/IP procedures and application for the GTS Þ Þm _m .1.1 Þ 1_ Cabinet-1 GTS Connection with NAT NAT BGP Routing 193.105.180.129 193.105.180.130 NAT Table: Firewall 134.178.6.5 202.203.190.1 = 10.1.1.1 Firewall 10.1.1.1 7, Office V V _V 7,rnet w ce netwall Cabinet-1 TCP/IP procedures and application for the GTS How do you know which way to send ip packets – routing protocol GTS Private or Public Addresses Firewall Regional Offices Internet Head Office Public Addresses WEB FTP Message Switch TCP/IP procedures and application for the GTS Routing • Two types of routing: Static and Dynamic • An internal routing protocol is used within your network. • The GTS uses BGP for routing (static routes can sometimes be used for stub networks) • ATTACHMENT II-15 Use of TCP/IP on the GTS give examples of setting up BGP Routing on a Cisco router – does not cover use of NAT. TCP/IP procedures and application for the GTS Example of routing table gatekeeper-gw#sh ip route S 139.163.28.254/32 [1/0] via 139.163.79.1 B 202.245.39.0/24 [20/0] via 193.105.178.22, 2d23h S 157.128.0.0/16 [1/0] via 202.12.61.9 B 203.10.243.192/27 [20/1] via 203.10.243.13, 05:46:25 TCP/IP procedures and application for the GTS BGP • Used by WMO on GTS • Uses a tcp connection on port 179 between to routers to send updates. • Each Network is given an Autonomous System (AS) number. • WMO have allocated AS numbers out of the private AS address range for the GTS TCP/IP procedures and application for the GTS GTS AS Numbers • Private range: 64512 through 65535 • MTN Centres and reserve: 64512 to 64639 • RA I: 64640 to 64767 • RA II: 64768 to 64895 • RA III: 64896 to 65023 • RA IV: 65024 to 65151 • RA V: 65152 to 65279 • RA VI: 65280 to 65407 • Antarctic and reserve: 65408 to 65535 TCP/IP procedures and application for the GTS Local BGP links • Allocate AS numbers for private links out of range: 65472 to 65535 • All GTS should not route this range. TCP/IP procedures and application for the GTS Example of BGP routing gatekeeper-gw#sh ip bgp neigh 193.105.178.22 route BGP table version is 205, local router ID is 134.178.31.9 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 140.90.88.0/24 193.105.178.22 0 64520 64513 i *> 202.245.36.0 193.105.178.22 0 64520 ? *> 202.245.39.0 193.105.178.22 *> 205.156.51.96/27 193.105.178.22 Total number of prefixes 4 gatekeeper-gw# 0 0 64520 i 0 64520 64513 i TCP/IP procedures and application for the GTS BGP Conifiguration router bgp 64512 no synchronization network 134.178.0.0 redistribute ospf 101 metric 20 match internal neighbor 193.105.178.22 remote-as 64520 neighbor 193.105.178.22 distribute-list 10 out neighbor 193.105.178.22 filter-list 4 in neighbor 193.105.178.22 filter-list 1 out ! ip as-path access-list 1 permit ^$ ip as-path access-list 4 permit ^64520$ ip as-path access-list 4 permit _64520$ ip as-path access-list 4 permit _64513$ ! access-list 10 permit 134.178.6.0 0.0.0.255 access-list 10 deny any TCP/IP procedures and application for the GTS Useful cisco BGP commands • • • • Sh tcp Sh ip route Sh ip bgp neighbor 1.1.1.1 route Sh ip bgp neighbor 1.1.1.1 advert TCP/IP procedures and application for the GTS NAT • Static and Dynamic • Static needed for GTS so that hosts inside the network can be contacted and for security. • NAT addresses must appear in BGP routing table. TCP/IP procedures and application for the GTS TCP overview • Connection oriented and reliable. • TCP uses a port number to define connections • Connection defined by source IP address/source port and destination IP address and destination port • Can have multiple connections to the same TCP port number TCP/IP procedures and application for the GTS TCP Packet format TCP/IP procedures and application for the GTS Common TCP ports • ftp-data 20/tcp # File Transfer Protocol (Data) • ftp 21/tcp # File Transfer Protocol (Control) • telnet 23/tcp # Virtual Terminal Protocol • smtp 25/tcp # Simple Mail Transfer Protocol • http 80/tcp # World Wide Web HTTP • pop3 110/tcp # Post Office Protocol - V 3 • GTS ports >10000 TCP/IP procedures and application for the GTS UDP • Connectionless not reliable • Not used for GTS transfers • Examples: used for network management (SNMP), voice data TCP/IP procedures and application for the GTS FTP • Uses 2 TCP connections: Control (port 21) and data (port 20) • Two modes: normal and passive. • Used for transferring files. TCP/IP procedures and application for the GTS FTP Operation Normal Client host - connects to port 21 Client host “give me file on port 2345 Client/2345 host/20 –connects to port 2345 Passive Client host - connects to port 21 Client host “give me file on port 2345 Client host/2345 –connects to port 2345 TCP/IP procedures and application for the GTS FTP Commands get Retrieve a file put send a file binary send or retrieve a file in raw binary format (no processing) cd Change directories on the remote system rename Rename a file on the remote system Hash display a ‘hash’ symbol which indicates how much data has been sent. Ls List the directory on the remote system. TCP/IP procedures and application for the GTS FTP Example C:\>ftp gorgon.ho.bom.gov.au Connected to gorgon.ho.bom.gov.au. 220 gorgon FTP server (Version 1.7.212.5 Wed May 30 12:19:42 GMT 2001) ready. User (gorgon.ho.bom.gov.au:(none)): anonymous 331 Password required for anonymous. Password: 230 User gvm logged in. ftp> cd temp 250 CWD command successful. ftp> binary 200 Type set to I. ftp> put info.txt 200 PORT command successful. 150 Opening BINARY mode data connection for INFO.TXT. 226 Transfer complete. ftp: 833 bytes sent in 0.01Seconds 83.30Kbytes/sec. ftp> rename info.txt to final.txt 550 info.txt: No such file or directory. ftp> rename INFO.TXT final.txt 350 File exists, ready for destination name. 250 RNTO command successful. ftp> ls 200 PORT command successful. 150 Opening ASCII mode data connection for file list. test.zip final.txt 226 Transfer complete. ftp: 62 bytes received in 0.00Seconds 62000.00Kbytes/sec. ftp> TCP/IP procedures and application for the GTS WMO Standards • FTP transfer • Socket Connections TCP/IP procedures and application for the GTS WMO Socket Connections • WMO Use TCP ports > 10000 – Suggest that use ports > 30000 • Use separate sockets for ASCII and Binary data and separate sockets for transmit and receive. • Maintain socket connection • Old sockets should be closed when a new connection to the same port from the same host occurs – avoids problems with connection loss. TCP/IP procedures and application for the GTS WMO Sockets Continued • Use CSN (channel sequence numbers) manditory – recommend 5 character CSN • Each message is preceded by a message length field of eight ASCII characters and a message type field of two ASCII characters. – BI for binary, AN for alphanumeric or FX for facsimile TCP/IP procedures and application for the GTS Socket Data Format Message length Message nnn type SOH CR CR LF or CR CR LF Heading (8 characters) (2 characters) nnnnn Message length Message length : Length from SOH to ETX (e.g. 00001826 = 1826bytes) Message type AN: Alphanumeric, BI: Binary, FX: facsimile CR CR LF ETX TCP/IP procedures and application for the GTS Socket Programming • See ATTACHMENT II-15 Use of TCP/IP on the GTS TCP/IP procedures and application for the GTS WMO FTP Procedures • Procedures for accumulating messages into files so as to minimise FTP overheads with short messages (applies only to existing message types); • file naming conventions for existing message types (existing AHL); • file renaming; • use of directories; • account names and passwords; • FTP sessions; • Local FTP requirements TCP/IP procedures and application for the GTS Accumulating messages into files • Multiple messages in the one file • Messages should be accumulated in files thus: – – – – – – – length indicator, message 1 (8 characters); format identifier (2 characters); message 1; length indicator, message 2 (8 characters); format identifier (2 characters); message 2; and so on, until the last message; TCP/IP procedures and application for the GTS FTP message format Message 1 Format nnn length IdentifierSOH CR CR LF or CRCR LF Heading Text (8 characters) 00 nnnnn Message 2 CR CRLF ETX length (8 chacs) Message length Option 1. Starting Line and End of Message present Message length : Length from SOH to ETX (e.g. 00001826 = 1826bytes) Format Message 1 Identifier CR CR LF Heading length 01 (8 characters) Text Message 2 Format Identifier length (8 characters) 01 Message length Option 2. Starting Line and End of Message absent Message length : Length from first CR to end of Text (e.g. 00001826 = 1826bytes) TCP/IP procedures and application for the GTS File naming conventions • CCCCNNNNNNNN.ext where: – CCCC is the international four letter location identifier of the sending Centre, as defined in WMO publication No. 9, Volume C; – NNNNNNNN is a sequential number from 0 to 99999999 generated by the sending Centre; – ext is – ‘ua’ for urgent alpha numeric information – ‘ub’ for urgent binary information – ‘a’ for normal alpha numeric information – ‘b’ for normal binary information – ‘f’ for facsimile information TCP/IP procedures and application for the GTS File renaming • most centres detect the presence of a new file by scanning a directory. • To avoid problems with the receiving centre processing a file before it has completely arrived, all sending centres must be able to remotely rename the files they send • The file shall be sent with the extent ‘.tmp’ and then renamed • Recommended that a separate directory be used for each host system which is initiating FTP sessions to avoid the possibility of filename duplication TCP/IP procedures and application for the GTS General FTP “Rules” • Anonymous FTP may be used, but not on servers accessible from the Internet • To Limit load, only one ftp session per centre per file type • receiving Centres to delete files after they have been processed • Do not use compression of files. TCP/IP procedures and application for the GTS FTP suggestions • Use format identifier “00” – This allows the WMO request/repeat service to recover missing data. • Use filename of *.b to exchange alphanumeric or binary messages – CCCCNNNNNNNN.b - for alpha numeric and binary – CCCCNNNNNNNN.f - for facsimile (FAX T.4) • Send one T4 chart in each file • Send up to 100 messages in a file but do not delay sending a message for more than 60 seconds. • Read incoming files at least every minute. TCP/IP procedures and application for the GTS Socket/FTP Comparison • Sockets: – Quick, low overhead – Requires programming – Request/Repeat system can be slow • FTP – More Delays – Standard clients (less programming) – Easy to see failures and repeat transmission. TCP/IP procedures and application for the GTS Checklist for GTS link • Link requirements: – 1. Get link addresses and private AS numbers from WMO – 2. Agree whether to use BGP or not – 3. Establish connectivity between routers. TCP/IP procedures and application for the GTS Checklist for GTS link cont. • Use only official IP addresses • Exchange details on host names. • Declare which IP addresses in your Centre are eligible to use the GTS. • Establish an IP connection with one or more Centres. • Configure dynamic routing with BGP (or static routing) • Obtain an autonomous-system number • Check the barrier between Internet and the GTS • Filter incoming and outgoing traffic in accordance with the requirements described above TCP/IP procedures and application for the GTS Checklist for GTS link cont. • WMO socket requirements: – Define socket/port numbers to receive on – Agree on 3 or 5 digit sequence numbers • FTP requirements: – Exchange user-id and password of receive accounts – Exchange directory names – Agree on format identifier – preferably “00” (include WMO header/trailer) – Agree on filenames. Suggest: – Exchange information on maximum messages to be in a file and delays before sending a file and delays before reading a file (not essential but is useful information) – Agree on 3 or 5 digit sequence numbers TCP/IP procedures and application for the GTS Email Standard • Proposed standard in documentation. TCP/IP procedures and application for the GTS END