PPP

https//www.racom.eu/eng/support/morse/prot_ppp_a.htm
1. Introduction 

The PPP protocol serves for connecting 2 points of the IP network
over the serial link in the IPGW format.

It provides similar working modes as the Ethernet channel in the MR25ET. 

Also see the Ethernet article in the MORSE Firmware document, which is 
available at www.racom.cz, in chapter 
Software / Service Terminal / MORSE Firmware-Documentation / Ethernet.



2. Data Format

PPP protocol data contains an IP datagram with a PPP flag: 

| ppf/8 | lch/8 | IP datagram | fcs/16 | ppf/8 |    
   7E      21     ………..    ….     7E    

where:
ppf           flag PPP
21            LCP header
IP datagram   (packed into the escape sequence)
              An informative description is given in the article: 
              “Format of UDP datagram IPGW for Morse”
fcs           frame check sequence (checksum PPP)

Example of PPP protocol data:

|ppf|lch|                 IP header                       |   UDP header
 7E  21  4500 0036 000F 4000 4011 B814 C0A8 00A1 C0A8 00A2 22B8 22B8 0022 

    |                   pseudoframe                                  |   
FA55 D000 0000 690F 12A2 690F 12A1 0E09 690F 12A2 690F 12A1 AAAA C5D7 

| fcs  | ppf |
  083C   7E 

See – RFC-1661, RFC-1662
    – Format of UDP datagram IPGW for MORSE



3. Implementation of the Protocol in the MORSE system 

The PPP protocol enables communication in three modes:


3.1. M-IP-M, i.e. routing via IP 

The section running along the IP network is inserted into the route of 
the packet in the MORSE network. It is used for example when checking 
a remote MORSE network.

 \|/…..\|/          
 _|_     _|_           _____                   ________
|   |   |   |Net      | PPP |                 |        | 
|___|   |___|………|_____|……………..|________|…
                        SCC0   serial line      router    :
                       M-IP-M                             :
                                                          :
                …………..(  Internet  )…………..:    
                :                                            \|/…..\|/
                :    ________                  _____         _|_     _|_
                :   |        |                | PPP |ret    |   |   |   |
                :…|________|…………….|_____|…….|___|   |___|
                      router    serial line     SCC0
                                               M-IP-M 


Configuration – the network output of the node (Net) goes to the SCC 
                with the PPP protocol 
              – the routing output SCC (ret) goes to the node 

A packet exiting a MORSE network node is given a “to” MORSE address and 
gets to the SCC channel via the node network output. Here it is assigned 
an IP address, found in the (A)rt table according to its “to” MORSE 
address. Then the packet is packed into a UDP datagram, PPP flags and 
a checksum are attached and the packet is sent along the serial link to 
the router.

In the destination router (IP host) a check is made as to whether the IP 
network route is also defined here in the opposite direction. If not the 
packet is rejected (REJ), if yes the UDP packing is removed from the 
received packet. An original MORSE packet obtained in this way goes via 
the SCC routing output to the MORSE node with the “to” address from where 
it continues through the MORSE network.



3.2. IP-M-IP, i.e. IP2MORSE 

The section running along the IP network is inserted into the route of 
the packet in the MORSE network. It is used, for example, for access to 
the Internet via the MORSE network.

                                                    \|/……\|/…….
                 _______             _____          _|_      _|_      :
                |       |           | PPP |user    |   |    |   |     :
( Internet )….|_______|………..|_____|……..|___|    |___|     :
                 router  serial line  SCC0                            :
                                     IP-M-IP                          :
     \|/……. ->                                  <- ……………:
     _|_           _____             ______             MORSE network  
    |   |user     | PPP |           |  PC  |
    |___|………|_____|………..|______|
                   SCC0  serial line
                  IP-M-IP

Configuration – user output of the node (user) goes to the SCC with PPP 
                protocol
              – user output SCC (user) goes to the node 

The IP address of the packet coming from the IP network is found in the 
(I)Part table. 
– If it is found the respective gw is used as the MORSE destination 
  address. 
– If it is not found and if it agrees with the actual IP address within 
  the range of the mask (m)ask, then the MORSE dest address is made up 
  of the actual MORSE address and the lower part of the IP address within 
  the range of the (m)ask.
– In other cases the default gw from the (I)PArt table is used.

In the destination node of the MORSE route the packet is sent to the SCC 
channel through the user output. The MORSE pack is removed and the UDP 
packet is sent to the serial link.



3.3. Morse Application Server MAS, i.e. M-MAS-IP 

MAS mediates communication between several applications in the connected 
LAN network and MORSE networks.
                                                             
           | MorseDst   <—————————|        |dst MorseDst
           |                         ____           |        |
MORSE      |                        |APor|      <—|        |src AppPort
network    |                           |            |   to   |
           |                         __V______      |<–IPMas|
 \|/.      |”dest” < (s)Art < “gw”= |….|….|     |   port | 
 _|_ .  e–|   |                           ^        |   8888 | 
|   | .    |   V                     ______|__      |        |
|___|  .   | MorseSrc               | IPA|ddr | <—|        |src IPAddr
        .                                                    
         .          IPMas                          IPAddr
 \|/…..\|/        port8888                        ____            _____
 _|_    __|__       _____             ___          |    |.AppPort..|_____|   
|   |  |     |<…u|     |           |   |         |    |           _____
|___|  |     |     | PPP |           |   |..(LAN)..| PC |…port2..|_____|
       | ->L>|u…>|_____|………..|___|         |    |           _____
       |_____|      SCC0  async link               |____|…port3..|_____|
      .  CU         MAS              router                        appli- 
     .                                                             cations 
    .      
 \|/       | MorseSrc   —————————>|        |src MorseSrc
 _|_       |                         ____           |        |
|   |   –>|                        |APor|      —>|        |dst AppPort
|___|      |                           ^            |   from |
           |                         __|______      |–>IPMas|
           |”dest” > (s)Art > “gw”= |….|….|     |   port |
           |   ^                           |        |   8888 |
           |   |                     ______V__      |        |
           | MorseDst               | IPA|ddr | —>|        |dst IPAddr


The HW route is represented in the diagram in the centre.  The MORSE 
network, from which packets arrive to the central CU with the PPP 
protocol and configured MAS, is on the left. 
From here via the asynchronous link to the router, which is connected to 
the computer via the LAN (not however via WAN or the Internet).  Various 
applications run on its ports and in this way communicate with MORSE 
network stations.

Processing of the addresses from the application to the MORSE network is 
indicated in the upper part of the diagram.  The packet sent from the 
application carries the MorseDst address, which is used without change 
in the MORSE packet sent from the CU.  Furthermore the packet is given 
a source IP address, IPAddr, and port number, AppPort.  The packet with 
this set of information is sent to port 8888 of the MORSE Application 
server IPMas.  Here the source address MorseSrc is created from AppPort 
and IPAddr as described below. The packet is given MorseDst and MorseSrc 
addresses and then sent to the MORSE network.

The destination MORSE station then uses this address MorseSrc for 
sending a reply to MAS, see the lower part of the screen. The MorseSrc 
address of the received packet passes through directly. dst AppPort and 
dst IPAddr, to which the reply is delivered, are created from the 
MorseDst address, see the next description.

The  MAS function can also be approximated to operation of the RANEC 
monitoring system. Here the polled Morse network is connected via the CU 
in the MAS function with the LAN network, to which the RANEC server 
computer with six applications (demons) is connected.  The demons 
successively call on the points of the Morse network via MAS, which 
assigns its source MORSE address to each packet leaving the demon to the 
network.  Replies then arrive to these addresses from the network and 
using the “multiaddressing” (represented using ->L> ) function all these
replies are sent from the node via the user port to MAS. This then 
distributes them using the respective application around the LAN network 
according to these addresses, previously source and now dest.  

Configuration – user output of the node goes to the SCC with PPP protocol
              – user output goes to the node
              – switch on the Multiaddressing function (Ne, 1MLo)

An IP packet sent from the application to a MORSE network point is given 
the IP address of the MAS server and port number 8888 dec. In MAS the 
application compiles a gw item from the source IP address and port number:
– port number sending application
  creates 16 MSB (Most Significant Bits) of the gw item
– 14 LSB (Least Significant Bits) of the IP address of application 
  creates 14 LSB of gw item.  These 14 bits form the address space of the 
  LAN network, in which we can move. 
– 15th bit is 0, in the case of a broadcasting packet it is 1
– 16th bit is reserved for the function of automatic assignment of  
  addresses
According to gw a Morse address is found in (s)Art. This address is used 
in the assembled MORSE packet as the source address, the destination 
address is already contained in the incoming IP packet.  A MORSE packet 
created in this way is sent via the SCC user output to the node and on to 
the MORSE network.

The packet from the MORSE network with a MORSE dest address of any of 
the applications arrives at the node from where it is sent, using the 
Multiaddressing function, via the user port to MAS. Here the gw item, 
from which the IP address and port number are created, is found in the 
(s)Art table according to the MORSE address of the application:
– 18 MSB from IPMas address supplemented by 14 LSB from gw create the 
  IP address
– 16 MSB from gw define the application port number 
The packet is sent over the LAN network to the application running on 
this IP address and port.



3.4. Examples of Communication

Example of the passage of a packet in the M-IP-M mode. AAAA data is sent 
from the node to the SCC, the PPP frame is then sent from the SCC:

>>
06:07:18.674 OUT    2 node (1): 690F110E 690F1109 |0809    0|
AAAA 
06:07:18.677 tx   59 | S01
7E21 4500 0036 0000 4000 4011 B94F C0A8 0009 C0A8 000E 22B8 22B8 0022 E708
D000 0000 690F 110E 690F 1109 0809 690F 110E 690F 1109 AAAA E6A8 4885 7E 

If communication does not take place a maintenance frame is sent every 
20 seconds:

06:07:31.842 tx   14 | S01
7EC0 2109 0100 0800 0000 00C7 437E 

06:07:52.340 tx   14 | S01
7EC0 210A 0100 0800 0000 0017 C97E 



4. Setting Protocol Parameters 

Arrangement of parameters in the Setr menu:

PPP parameters:
Wanted options:
(L)oc IP:C0A80009h 192.168.0.9   
(R)mt IP:C0A8000Eh 192.168.0.14   
Got options:
         C0A80009h 192.168.0.9   
         C0A8000Eh 192.168.0.14   
mr(u):1500
(h)ayes simulator:OFF
LCP m(a)gic:ON    obsolete LCP ma(G)ic (sv465..sv479):OFF
(F)lags:0
IPG(W)
(q)uit
>>W

(L)oc IP    – IP address of local end of the PPP link
(R)mt IP    – IP address of remote end of the PPP link 
              Simply insert (L) and (R) into the protocol on one side of 
	      the link, the opposite protocol PPP obtains this data when 
	      making a connection with the LCP protocol.
              Similarly it is possible to insert on each side only (L) 
	      or only (R).
Got options – IP addresses got when making a connection with the LCP 
              protocol. These addresses then appear in the transmitted 
	      packet.
mr(u)       – max. length of transferred packet after fragmentation, 
              max.1600
(h)ayes simulator – emulates the function  of the telephone modem when 
              the computer is communicating with the IP network through 
	      the MORSE channel
LCP m(a)gic – switches on the function of negotiating the magic number. 
              Set using ON
obsolete LCP ma(G)ic – not used 
(F)lags     – reserve, 0000
IPG(W)      – opens menu of parameters for IPGW. Parameters together with
              Ethernet channel parameters and their functions are 
	      described in the Setr description, i.e. in the 
	      “Morse Firmware Documentation” material. 
	      Available at www.racom.cz, chapter
              Software / Service Terminal / MORSE Firmware-Documentation.

Example of IPGW parameters:

  INTERNET PROTOCOL GATEWAY:
M-IP-M:
  (A)rt:1
  (r)epeats:0002  (t)imeout:500  (p)roxy timeout:0s
  (f)rag size:400bytes  (g)lue (append) up to:0packets
IP-M-IP:
  (I)PArt:0
  (m)ask:00000000  IP(F)rag. size:552
MAS:
  (s)Art:0
  (B)ase:00000000  (M)ask:00000000
     BEWARE! IF YOU CHANGE CONTENT OF THE ART TABLE,
     YOU SHOULD RESTART (INIT) THIS PROTOCOL!
  (P)inger (S)tatus
(q)uit
>>

©  2024 RACOM s.r.o. All Rights Reserved.