LinuxKoku
Posts: 4
Joined: Wed May 16, 2018 9:16 am
Location: France

Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Wed May 16, 2018 9:47 am

Hello,

I am working on a project using a Raspberry PI 3 for the development of a program to comply with the TS13 149 standard of passenger counting systems for public transport vehicles produced by the company in which I am doing my traineeship. The purpose of the project is to introduce network management protocols based on a TCP / IP (Ethernet) link. To do this, the standard requires a service-oriented architecture (SOA) and the following protocols:

FTP: For file transfer
SSH (Secure Shell): to make secure (encrypted) connections between a client and a server.
HTTP: For the search for correspondence between names and IP addresses
mDNS: Simplifies name resolution and enables dynamic scalability and evolution in a local network.
TCP / UDP: For data transport
DHCP: For automatic configuration of IP parameters of a station or machine
IP (IPv4, IPv6): For the address space
Ethernet: For the link

Having never made a network on a RaspberryPi, I would like to know if this is feasible, and if so, offer me a documentation, tutorials, or similar codes from which I could inspire me.

Thank you all
Thank you all :)

epoch1970
Posts: 1465
Joined: Thu May 05, 2016 9:33 am

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Wed May 16, 2018 12:13 pm

I don't know about the TS13 149 standard but for the rest it looks pretty common and should work fine on Pi 3.

- Download Raspbian and read the official documentation for a start.
- When looking for information: Raspbian is based on Debian which itself is a Linux distribution.

Correction: Don't feed the trolls.
(sorry)
Last edited by epoch1970 on Wed May 16, 2018 5:53 pm, edited 1 time in total.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

LinuxKoku
Posts: 4
Joined: Wed May 16, 2018 9:16 am
Location: France

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Wed May 16, 2018 3:14 pm

Thank you for your reply ;) ,

As you suggested, I installed a Raspbian version (debian adapted to Raspberry). And if you want more information about the standard, in fact, this Raspberry PI is the basis of an embedded system, a traveler counting system in buses or trams, the goal is to set up an Ethernet management on this counting hardware to ensure the reception of TCP / UDP (record frames) count frames from camera cells, to do this, I will use the Python environment under Linux. For the scripts, I have nothing for the moment, they just gave me the mission to make this connection with these specific protocols, which includes all layers of the OSI model, in summary! The connection of (Bus / Tramway) at this moment is programmed following these protocols quoted (International Standard), so the data exchange between the systems embedded in a Bus / Tramway and our device must be done according to this norm, because that I think that if we do not have the same protocols, the link will be impossible and our device will not be recognized.

My question for starting this project is: how to create and program an Ethernet link on a Raspberry Pi 3? (Links for Codes and tutorials will be welcome).
Thank you all :)

tpyo kingg
Posts: 52
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Wed May 16, 2018 3:25 pm

Perhaps I am misunderstanding but to connect a Raspberry Pi running Raspbian, it is enough to plug in to an Ethernet port if DHCP is enough. If you need a static address, then that is easy to arrange, too, if one has been assigned to your project from your network's administrator.

https://www.raspberrypi.org/learning/ne ... p-address/

If you mean something else, please explain a bit more.

On the side. of the list of protocols you have on your list, I would give serious reconsideration to the idea that FTP be used. The 1970s as well as the 1980s have come and gone and FTP is no longer appropriate. It is hard to set up and on top of that cannot be made secure. For read-only download, HTTP or HTTPS is much, much easier to set up, and the latter gives reasonable privacy. For mixed upload/download, SFTP is the safe alternative.

B.Goode
Posts: 5559
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Wed May 16, 2018 3:28 pm

My question for starting this project is: how to create and program an Ethernet link on a Raspberry Pi 3?
Does your assignment really require you to "create and program an Ethernet link "?

Can't you simply take advantage of the fact that the RPi Ethernet interface is fully supported by the TCP/IP implementation built in to the Raspberry Pi Foundation Raspbian Operating System?

(Isn't that one of the advantages of the OSI network model, although idealised: that you can benefit from the infrastructure provided by lower layers of the stack without having to re-implement them for each new instance of hardware?)

LinuxKoku
Posts: 4
Joined: Wed May 16, 2018 9:16 am
Location: France

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Thu May 17, 2018 10:09 am

Hello,
in order not to mislead you tpyo kingg, I tell you what was written on the document of the standard to follow, about the use of TCP with (FTP, HTTP, SSH):
Communication Protocols

1 The IP suite
The Internet Protocol suite is the set of communications protocols used for the Internet and similar
networks, and generally the most popular protocol stack for wide area networks. Under the huge
number of protocols based on IP the following are recommended in this Technical Specification.

2 The TCP framework
2.1 Transport Control Protocol (TCP)
The Transport Control Protocol is a transmission protocol for connection oriented communications.
This means that this protocol covers the need to introduce, establish and manage a secure end to end
connection between two entities or destinations. The detailed description and specification are in the
RFC793.
TCP should be used for the exchange of most data types, where time is not critical. It supports the
application layer protocols HTTP, FTP and SSH, which should be used as indicated below.

2.2 HyperText Transfer Protocol (HTTP)
The HyperText Transfer Protocol is based on TCP. In addition, HTTP defines nine methods (sometimes
referred to as “verbs”) indicating the desired action to be performed on the identified resource. In
systems based on the EN 13149 series, the two most important methods are likely to be the GET and
the POST methods. The detailed description and specification are in the RFC2616.
HTTP protocol should be used for event triggered data (see 6.3.1).

2.3 File Transfer Protocol (FTP)
The File Transfer Protocol is based on TCP and is used for file transfer between two entities. The
detailed description and specification are in RFC959.
FTP protocol should be used for file transfer.

2.4 Secure Shell (SSH)
The Secure Shell Protocol is based on TCP. It is used for remote terminal access and control. The
detailed description and specification are in RFC4253.
SSH protocol should be used for remote terminal access and control.


B.Goode, My mission is that my Raspberry PI is configured with these protocols, being a beginner in Raspberry PI's network programming, I do not know whether to code these protocols as for a PIC with C, or just as you say! Take advantage of the RPI3 and just configure!
How can I start to configure my RPI, and with which protocol to start? I saw on tutorials that for the first start of my RPI, this one is configured first with an SSH, I would start to do his, then she is the way to follow that you will advise me?

Thank you
Thank you all :)

tpyo kingg
Posts: 52
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Thu May 17, 2018 10:38 am

LinuxKoku wrote:
Thu May 17, 2018 10:09 am
2.3 File Transfer Protocol (FTP)
The File Transfer Protocol is based on TCP and is used for file transfer between two entities. The
detailed description and specification are in RFC959.
FTP protocol should be used for file transfer.
Thank you. I would again point out that FTP should not be used. For download without privacy there is HTTP. For download with a modicum of privacy there is HTTPS. For secure, private upload and download there is SFTP which comes as part of most SSH services unless you go out of your way to turn it off or remove it. So it would be a very good idea to get point 2.3 of your assignment modified for SFTP or HTTPS or just removed from the requirements.

It would take very many years of full-time work for a single individual to re-implement all of those rather than using the pieces provided by your average GNU/Linux system. So it sounds like you are not required to actually re-write or re-implement these technologies but are being asked to use the ones provided and running on your RPi. First question: Is that correct? If so, then look at the below packages.
Second question, which distro is this for? Raspbian is a good choice for starting bare-bones and adding pieces as needed.

2.4 Secure Shell - provided by OpenSSH which is built-in or, if you want to get crazy and need only certain components, DropBear

2.3 Avoid FTP. Really.

2.2 HyperText Transfer Protocol (HTTP / HTTPS) - provided by either Nginx or Apache2, both of which are in the repositories.

2.1 TCP - A full network stack is already provided by default. There you have TCP, UDP, and ICMP and more.

hippy
Posts: 2837
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Thu May 17, 2018 12:01 pm

LinuxKoku wrote:
Thu May 17, 2018 10:09 am
B.Goode, My mission is that my Raspberry PI is configured with these protocols, being a beginner in Raspberry PI's network programming, I do not know whether to code these protocols as for a PIC with C, or just as you say! Take advantage of the RPI3 and just configure!
I think you are getting too bogged-down in how things are at the lower level and really need to concentrate on how things are done at the higher level.

As it seems to be a matter of getting data from one place to another then high level protocols will do that. Raspbian will have everything below those to just make things work and that's probably the best starting point.

It's a bit like being a TV executive; you don't have to worry about what cameras, cables and magic boxes there are, what's digital, what's analogue, that there needs to be this distribution system and that, DVB, UHF, VHF; that all comes with the studio. Your job is to make TV shows not worry about what goes on behind the scenes or in the technical booths.

It would be worth talking to your manager to get a clearer picture of what it exactly is they want you to do as it seems it's not entirely clear. It is unlikely you need to deal with everything from top to bottom. Get your manager to point out exactly where in that stack of things you need to be working.

Whatever it is you need to do Raspbian will probably provide for it and is probably the best platform for that. Even if not it's the place to start.

hippy
Posts: 2837
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Thu May 17, 2018 12:07 pm

tpyo kingg wrote:
Thu May 17, 2018 10:38 am
I would again point out that FTP should not be used.
Though if that's what one side of the system expects then that's what will have to be used. The real world is not always as perfect as one would like it to be.

Obviously use better protocols in favour of worse where one can, but that option isn't always open.

LinuxKoku
Posts: 4
Joined: Wed May 16, 2018 9:16 am
Location: France

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Thu May 17, 2018 12:12 pm

tpyo kingg What you have to understand also is the standard requires these protocols indicated, so if I change a protocol, my Raspberry PI may not be recognized, the protocols have to be followed, because an engineer will test the product, and have to confirmed that all protocols cited are the correct ones.

I also took care of looking on FTP and SFTP, I think that the FTP can be very well configured (see the link below), or I have not yet understood how to proceed.

https://www.raspberrypi.org/documentati ... ess/ftp.md

Thank you very much for your answers
Thank you all :)

tpyo kingg
Posts: 52
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Thu May 17, 2018 12:26 pm

LinuxKoku wrote:
Thu May 17, 2018 12:12 pm
I also took care of looking on FTP and SFTP, I think that the FTP can be very well configured (see the link below), or I have not yet understood how to proceed.

https://www.raspberrypi.org/documentati ... ess/ftp.md
Don't change the requirements unilaterally. Just renegotiate FTP, it transmits account information and all data unencrypted. It is hard to configure, also with the firewall, and cannot be made secure. There are still a few unusual corner cases where it can be used over HTTP or SFTP. However, I would recommend that you seek confirmation as to why FTP is required in 2018 and get it in writing that you cannot be held liable for the problems that will unavoidably stem from its use in 2018. But enough from me on that, I'll let that drop for now. We just don't want to read about your project in the papers for the wrong reason some months down the line.

It's easy to verify that you have the rest of the protocols. As for the TCP/IP, what kind of proof do you need beyond the fact that your RPi is connected to the Internet and can reach other computers, say for update?

Code: Select all

ip addr show
ifconfig
man ip
man ifconfig

B.Goode
Posts: 5559
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

Thu May 17, 2018 1:56 pm

My mission is that my Raspberry PI is configured with these protocols, being a beginner in Raspberry PI's network programming, I do not know whether to code these protocols as for a PIC with C, or just as you say! Take advantage of the RPI3 and just configure!
How can I start to configure my RPI, and with which protocol to start? I saw on tutorials that for the first start of my RPI, this one is configured first with an SSH, I would start to do his, then she is the way to follow that you will advise me?
Non-technical answer: it sounds as though you have been "thrown in at the deep end". Please go and talk to your manager/supervisor/mentor/trainer to clarify what is required of you. (You are more likely to gain respect from focussing in this way, rather than by potentially wasting your employer's time by doing things that are not required.)

Technical answer. An RPi board is a tiny but fully capable computer system. It is capable of running a complete multi-user time-sharing Operating System such as the Raspberry Pi Foundation recommended and supported Raspbian. Raspbian is derived from Debian Linux. So as a Linux operating system it has a complete implementation of the whole TCP/IP network stack (both IPv4 and IPv6) as described in your specification. All the higher-level protocols listed are also supported. Since your aim is apparently to introduce a degree of Network Management into this situation it seems unlikely that you would start by writing low-level code to re-implement any part of the network stack. It is more likely that you will be expected to have a good grasp of the network protocols so that you can take informed decisions about what to monitor, measure and report?

This might be a good place to start reading about Network Management: http://www.snmp.com/protocol/snmp_rfcs.shtml

But to repeat: please seek advice from those you are reporting to and who have set you this assignment. There may be some technical details that are RPi specific, but most of your uncertainty would be the same if you were using a Windows or Mac system - those basics need to be cleared up first.

Return to “Other projects”

Who is online

Users browsing this forum: noteasy2 and 6 guests