Internet Explorer is not a supported browser for TI.com. For the best experience, please use a different browser.
Video Player is loading.
Current Time 0:00
Duration 11:14
Loaded: 0.00%
Stream Type LIVE
Remaining Time 11:14
 
1x
  • Chapters
  • descriptions off, selected
  • en (Main), selected

Hi, welcome to "HSR and PRP Redundancy on RT Linux." This is Part 4: Linux Commands. As you might imagine, this is one part of a multipart series. And if you'd like to go check out what's in the entire series, feel free to skip down to the For More Information slide toward the end of this video, and it will have a link to the overall series. And you can check out the other pieces, and check on the prior content if you'd like to do that before you proceed.

In this part, we're going to discuss the Linux commands that are used to create an HSR or PRP connection, how to use those connections, and then some statistics commands that you can use as well to get some information about those connections. This is the architecture that we've laid out over our previous sections in talking about HSR and PRP, and the redundancy they provide, and the value that that redundancy capability provides, several of the markets that we've been discussing. We've looked specifically at substation automation, for example, and how the different networks in that need the redundancy in order to make sure that one common failure doesn't bring down a piece of the smart grid, for example.

So in here, we're going to focus just specifically on the commands that you use inside of Linux to create an HSR or a PRP connection. And then, we'll look at some of the commands that you use to utilize that connection. So here we're going to focus on the command to create the HSR connection. So we're focusing in up here on the ip command. And we'll look at how that command is going to be used.

But first off, you need to have two ports for the redundant connections. So in this example, we've simplified it to show two ethernet ports coming up to eth2 and eth3 as instances of the network stack. And these would be basic connections that you could use for any socket programming. And we've got two of those. We want to merge those into an HSR or PRP redundant connection.

So let's take a look at doing that. And there's the ports that we're focusing in on, eth2 and eth3. Before we get into actually creating the HSR PRP connection though, we do need to do some configuring of the actual ports themselves. For example, for either one of HSR or PRP, the MAC addresses of the ports need to be the same. They're a redundant network.

So in order to change those Mac addresses, the first thing we do is take those interfaces down with an ifconfig down for that interface. Then we change its MAC address. And we do that for both ports to set them to be the same MAC address, so you probably only would change one. And then you bring those interfaces back up so that they're ready to be used.

And that's all the port configuring you'll need to do in order to go ahead and create that HSR connection. So we'll slide back over to the ip command that we're going to use to create that connection, and how that's going to set up this HSR connection using those eth2 and eth3 ports that we've configured with the same MAC address. So here's that ip command. You can see here what it is is ip link add and a bunch of stuff that you can read.

And you can see that one of the important things there is the type, HSR or PRP. And you can see the two slave interfaces that are being used. We kept things consistent to use the slave2 and slave3 that we used earlier. And we also tell the command that we've got some basic supervision built in as well.

So with this, you take your eth2 and your eth3 that were connections up to the network stack. You merge those into an HSR or a PRP connection using the ip link command as you see here. And that creates either an hsr0 or a prp0. And then, you can use ifconfig on that port to set an IP address for that port. And obviously, if you're doing an HSR ring, for example, you would want to make sure that it had an IP address that was consistent with the ring.

And then, you would bring that port back up. So now you'd have an hsr0 port up, configured with the proper IP address, and ready for redundant communication at the application level. So here is an example of that. And here we're going to use the simplest example you can use when you're thinking about networking, which is just the ping command.

So we're focusing in back up again at the user space or the application level. And we're using, like I said, a simple ping command to validate that that HSR link is being used. We're going to use a ping command with the IP address that we used for that HSR or PRP connection. And that's going to send the ping data out over that redundant network. And of course, you get a ping back as well to do that, to make sure that you've got a proper connection.

And ping is just one example of what you could use. If you already have a networking application that you want to test, you should be able to use that. But of course, using something as simple as ping is a good way to start. iperf can also be used to measure bandwidth, or just to run longer term stability tests and stuff like that that you would normally do with a typical network.

And as we stated earlier, HSR or PRP is going to be treated as just any other ethernet interface. But it's going to have that redundancy built in provided by that HSR or PRP driver. So now that we've got that redundancy, if our good friend Mr. Ax comes back that we talked about in previous sections and happens to disconnect one of these ethernet connections, what would you expect to happen?

And of course, if the redundancy is working correctly, the packets should continue to flow. Whether it be a ping or an iperf, you should see those packets continue to flow, and they should switch pretty much instantaneously from one link to the other. You can actually see feedback in a Linux console that shows that you lost a connection. But you only lost one connection of the redundant link, and the other connection will kick right in.

We can actually show this with 2 AM57xx IDKs as an example. So here is that IDK. IDK stands for Industrial Development Kit, since these protocols are typically used [? in a ?] lot of the industrial space. So these are evaluation boards that we've designed kind of to highlight some of the specific needs of those markets. So there's a picture of the board there. And then there's a block diagram on it.

And you can see the important pieces that we're interested in for this particular application, which is basically the processor, the ethernet ports being provided, in this case, by the PRU. And you could also do this over the CPSW or the regular ethernet interface as well for all practical purposes. And of course, if we want to have a network, we need to have multiple boards.

So will just drop two IDK down side-by-side. We'll hook up a couple of the ethernet interfaces so that we've got an HSR or PRP link, use the commands that we articulated earlier on both boards to create an HSR or PRP link with an IP address that's valid. And then, we can simply ping or iperf data between the two. And I don't like to waste ethernet cable, so I typically don't cut them with an ax.

Plus, I'm pretty sure that violates the safety requirements of my office. So I just disconnect one of the ports, and you can easily see that the data continues to flow. And you can actually switch back and forth. And with the real-time capabilities of HSR or PRP, you can actually do that fairly quickly. And all the packets should get to their destination with no problem, instantaneously switching from one connection to the other-- or at least as fast as you can plug or unplug a cable.

So that's one way that you can demonstrate HSR or PRP on Linux today utilizing a couple of TI boards that are readily available and orderable today. So here are a couple of other commands once you've got to link up, and running, and established. You might want to get some statistics or information about those links to see what's going on.

So you can simply grab some of the statistics, or evaluate the node table that's being maintained by the HSR driver. And you can look at some of this information. And this is a live data that was captured from two IDKs running the example application that we talked about earlier.

So that kind of brings us to the end of this short summary. We just wanted to share the commands that you need. So if you're not familiar with Linux, or if you've never used it before to work with HSR, which is still a relatively new capability, we wanted to provide that for you. So what I hope you saw was standard Linux tools and commands are used to work with HSR and PRP, much like most other networking applications.

You can even use familiar friends like ping and iperf to test those interfaces once you've got them established and connected to make sure that they're working. And even do fun things like start unplugging and plugging in cables to see what happens. You need a couple of boards to do that, so the AM57xx IDK is validated as a platform today that you could start looking at this as a potential platform for your HSR or PRP design.

We also looked at a couple of extra commands where the HSR driver is providing some useful statistics, as well as node table information that could be used, of course, at runtime to kind o understand what's going on with the network. And of course, the overall purpose of all this, if a cable gets disconnected, whether that be something as simple as just somebody unplugs the cable when they shouldn't have-- or in a more extreme circumstance where Mr Ax comes in and permanently disconnects one of the cables-- the packets should keep flowing from one source to the destination.

And that brings us to an end of this section. Just to share a few resources for you in our For More Information section, as I mentioned earlier, if you're interested in the rest of the content that's available with this series, the first link here is for that. You can go check out the series if you missed the previous presentations. Or if you'd like to see what else is available in this series, you can go check that out.

There are some other links here as well. For example, the IDKs that I mentioned, we've got the links for those so that you can go check those out if you're interested. Our software development packages are listed here as well. We've got a couple of existing reference designs, or TI designs, that use TI-RTOS. So they haven't been ported over to Linux at this time, but that's something that you can imagine we'll do in the future.

But you can see the overall structure, the different hardware tools that we use, different things like that for an HSR or PRP reference design there. And then, the last thing is our link to our E2E community where you can go search thousands of answers that we've already provided to other people that asked us questions-- and see if your question is answered there as well. Or if it's not, of course, you can post a new question. And we'll do our best to get to you and help you out.

Anyway, it's just a short presentation to share some of those Linux commands with you to kind of bring all together of the different things that we've talked about. I hope you found it useful. And I hope you'll go check out HSR or PRP on Linux. Certainly appreciate your time, and hope the rest of your day goes awesome. Thanks.