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

[Resolved] 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
Last edited by LinuxKoku on Mon Jun 11, 2018 11:44 am, edited 1 time in total.
Thank you all :)

epoch1970
Posts: 1767
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

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: 67
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: 118
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: 6011
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: 67
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: 118
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: 3164
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: 3164
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: 67
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: 118
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: 6011
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.

LinuxKoku
Posts: 67
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

Tue May 22, 2018 8:43 am

Thank you for your answers,

As you suggested I followed you instructions and I have some questions:

For the SSH, I made its configuration at the first start of the Raspberry PI3, as you suggested

For mDNS, I saw that it replaces DHCP and DNS, so very convenient, but does this protocol ensure the automatic configuration of IP parameters of the raspberry PI (a self-assignment as does DHCP) ?, if this is not the case, can we do a configuration of the two protocols?

For the TCP / UDP, for the transport layer, I can either use TCP with the mentioned protocols or UDP with other protocols, but the use of TCP is recommended

Regarding the FTP, I try to configure it but I can not, someone know a good tutorial ?, I've already tried 3, and I have a problem when I run the command <

Code: Select all

sudo nano /etc/vsftpd.conf
> --- the file opens but empty, so I can not make the required changes

Important questions:

- To configure all these protocols, should I start with those of the application layer following the OSI model, or can I configure them randomly?

- I found on various tutorials, that it is necessary to use sockets to define the ports of the protocols and to make their calls, therefore I have not limited myself to their configurations? if so, how are sockets used in this case?

Thank you ;)
Thank you all :)

scotty101
Posts: 2909
Joined: Fri Jun 08, 2012 6:03 pm

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

Wed May 23, 2018 2:12 pm

It is pointless configuring FTP etc unless you know what you are going to do with them.

Why would the user of your system need to use FTP?
What aspect of your project means that you need to communicate via HTTP? or SSH?
The specification you've given talks about protocols not what the system actually needs to do.

The Pi supports all of the protocols you've mentioned. Start using them.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

LinuxKoku
Posts: 67
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 24, 2018 8:09 am

Hello,

You are absolutely right, before starting the practice I first conduct a study on all these protocols and study all the possible solutions, but it turns out that I the company or I develop this project has components for Raspberry PI3 and PIC18F, these components are sold with any network links (most of the data are transmitted: D), now to optimize all transport at the international level, an organization ( http://itxpt.org/en/home) has implemented a new standard which therefore requires well-defined protocols for any link (this would help in efficiency the speed ... if all the components exchanged with the same protocols )

My study was first done on PIC18, and I found that one of these protocols required by the standard (SSH) is not yet implemented on the microchip TCP / IP stack for PIC18, and that 'it is arranged only on the PIC32, so the company must change all its hardware to meet the standard.

So I moved to the development of the standard on the Raspberry PI 3, and I am disturbing you by asking all these questions :oops:
For the data that all the mentioned protocols must interact between other components, it is camera cell data, which counts the climbs and decent of travelers (Tram / Bus). My mission is just to answer to the specifications (following the mentioned protocols)

I managed to install FTP which allows me to transfer files

I think to install the Apache server that communicates with the HTTP protocol

For domain name resolution I plan to install as indicated by the standard (the mDNS behaving like a DNS + DHCP, a way of optimization according to the standard, which requires it of course)
Thank you all :)

LinuxKoku
Posts: 67
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

Mon May 28, 2018 8:09 am

Hello,
For more information on my project! In fact, before we used an rs845 link to exchange data and orders with our counting systems. My job today is to set up an interface that should make it possible to abstract this link to make these counting systems accessible through standard / IP protocols and in particular to expose services using the http protocol.
I am looking to use a PI to integrate an embedded system and its specific hardware in an SOA architecture, by integrating all protocols cited one by one, but after doing several searches, another easy solution but may be the most accurate, indeed there is an OS that is specifically designed for that. It's called Windows 10 IoT Core, apparently all the protocols I need are already implemented there.

To summarize, my mission is to provide a PI that is able to interact with your RS485 counting systems and integrate into an SOA architecture using the IP / protocols I mentioned.

My questions :
:arrow: What is W10loT Core?
:arrow: What is its usefulness on a Raspberry Pi?
:arrow: Can I have more explanation on its use (how to use it, tutorials ... :roll: )?
:arrow: Do I just have to install W10IoT Core on a PI and drag it to the developers who will only have to code the translation rs485 <-> protocols / IP :!: ?
Thank you all :)

fruitoftheloom
Posts: 16731
Joined: Tue Mar 25, 2014 12:40 pm

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

Mon May 28, 2018 8:36 am

LinuxKoku wrote:
Mon May 28, 2018 8:09 am
Hello,
For more information on my project! In fact, before we used an rs845 link to exchange data and orders with our counting systems. My job today is to set up an interface that should make it possible to abstract this link to make these counting systems accessible through standard / IP protocols and in particular to expose services using the http protocol.
I am looking to use a PI to integrate an embedded system and its specific hardware in an SOA architecture, by integrating all protocols cited one by one, but after doing several searches, another easy solution but may be the most accurate, indeed there is an OS that is specifically designed for that. It's called Windows 10 IoT Core, apparently all the protocols I need are already implemented there.

To summarize, my mission is to provide a PI that is able to interact with your RS485 counting systems and integrate into an SOA architecture using the IP / protocols I mentioned.

My questions :
:arrow: What is W10loT Core?
:arrow: What is its usefulness on a Raspberry Pi?
:arrow: Can I have more explanation on its use (how to use it, tutorials ... :roll: )?
:arrow: Do I just have to install W10IoT Core on a PI and drag it to the developers who will only have to code the translation rs485 <-> protocols / IP :!: ?

Lots of questions, you do realise we are all Volunteers, Googling is good, though:


Windows 10 IoT Core is a Microsoft Product and they have a comprehensive web site:

https://developer.microsoft.com/en-us/windows/iot


RS485, you will require an Expansion Board:

https://pinout.xyz/pinout/rs485_pi
Adieu

LinuxKoku
Posts: 67
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

Mon May 28, 2018 11:51 am

Thank you for your answer

I have tackled a project where everything is unknown to me, I am very strong in other areas, but I am really motivated to realize this one, I'm doing well - on a lot of research, but my poor knowledge in the networks , make me doubt the links and tutorials that I li, I try to avoid a considerable loss of time by following the wrong path. I am sorry to be so broke : oops:

:?: I studied all these links and did my research, but, is this the only solution to achieve a service-oriented architecture (SOA) on my RPI3? or will I continue my configuration of the protocols and then think about an architecture (SOA)?
Thank you all :)

LinuxKoku
Posts: 67
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 30, 2018 12:51 pm

Hello !

After starting my Raspberry PI, I managed thanks to your help and tutorials, to configure on my Raspberry PI the protocols HTTP, FTP, SSH, mDNS, and its by testing these by visualizing the frames sent / received by the Wireshark (packet analyzer), I would now like to continue my specification by moving now to IP addressing, the standard requires an IPv4 or IPv6 address space (recommended), and an automatic assignment by choosing: DHCP Assignment || self-assignment (IPv6 or IPv4) || mixed assignment.

The mixed assignment is a bit complicated from my research, I told myself to go on the DHCP or IPv6 solution, knowing that we must meet these constraints:

DHCP assignment
- Dynamic Host Configuration Protocol (DHCP) is used to assign IP addresses. This server is responsible for assigning and managing unique addresses to each module, based on RFC2131.
- The address type follows IPv4 classes and IPv6 requirements based on the number of addresses that the DHCP server must handle.
- With DHCP, the addressing card may change dynamically. This should be considered when setting an environment with a DHCP assignment.
- The DHCP server must provide a range of special private addresses.
- A module that provides a DHCP server must be able to disable its DHCP server.

Auto-allocation
- IPv4 and IPv6 protocols both have standardized techniques for self-assigning IP addresses.
- For IPv4, RFC3927 defines the dynamic allocation of IP addresses in the range 169.254.0.0/16


:?: My questions:

:arrow: Most of the tutorials on a DHCP assignment offers me to make my RPI a DHCP server while I think it's not my goal, I just want one that my RPI can have an IP address automatically (DHCP assignment! ) and since at my first connection my RPi received an IP address, so I say that by default I am a DHCP client ?!
:arrow: When I run the command arp -a on Windows, I have the list of addresses on the same network, it shows me that my address is dynamic! so do I just have to be a DHCP client doing the configuration like tutorials, or by default?
:arrow: I would like an IPv4 address space, how do I know that my RPI has an IPv4 configuration?
Thank you all :)

Return to “Other projects”

Who is online

Users browsing this forum: No registered users and 1 guest