Subject: [IPP] Docker setup for IPP client | server

From: "Craig Whittle" <[email-masked]>
Date: Tue, 29 Nov 2016 19:03:24 -0800

All,

In between applying for new work opportunities and enjoying some time off, I
created an easy way to get the IPP sample code up and running using Docker
<https://www.docker.com/> , a streamlined container / virtualization
technology.  By following the steps below, you can get both an IPP client
and an IPP server going on Linux, Windows 10 | Server 2016, OS/X in very
little time.  The docker file pulls from the Git repository, builds the IPP
sample code, and configures the container so that network traffic can be
captured using tcpdump and viewed using the Wireshark on the host.  I have
the capture files for some of the IPP operations using these containers if
you would like these.  Using container technology enables us to have a
standard way to reproduce and report issues with the IPP sample code since
the environment would always be consistent.

The results of running the IPP client using the IPP everywhere test file are
attached.  The test on "PWG 5100.14 section 5.1/5.2 - Required Operations
and Attributes" failed.  Is this expected?  As Smith pointed out, the Docker
setup / environment  is not a usable configuration for self-certification.
The greatest value a Docker-based configuration provides is a fast / easy
setup that runs on multiple platforms that can be used for reference;
especially if you need a common platform / environment to reproduce issues.
The Wireshark file for the IPP everywhere test and the IPP server debug
message file are available upon request.  

To run IPP sample code on Docker

1.       From a shell prompt in the directory (on Windows 10|2016, OS/X, or
Linux) containing this docker file run: 

a.       docker build -t --security-opt seccomp=unconfined ubuntu[-ippserver
| -ippclient] .

b.       docker run -it -v d:\DockerShare:/data --security-opt
seccomp=unconfined ubuntu-[ippclient | ippserver] bash

2.       From the bash prompt on the newly created container as root, start
the services needed for Bonjour

a.       /# service dbus start

b.       /# service avahi-daemon start

To start the IPP Server

1.       In the ippserver container run

a.        /# ippserver -M byMyself -l rightHere -m coolPrinter -n myHost -p
631 -s 72 -vvvv myPrintService

2.       OR to run the server in debug mode using gdb

a.       gdb ippserver

b.       run  -M byMyself -l rightHere -m coolPrinter -n myHost -p 631 -s 72
-vvvv myPrintService 

Run the IPP Client 

1.       From the bash command prompt on the IPP client container and in the
/root/ippsample/examples directory with the IPP Server running, run:

a.       ippfind

                                       i.            Note the URL returned
(e.g., ipp://f8a365cfc7ec.local:631/ipp/print)

b.       ipptool [use the URL returned in step a.]
identify-printer-display.test

                                       i.            Note the "IDENTIFY from
172.17.0.4: Hello, World!"  message in stdout on the ippserver container

2.       To run the IPP everywhere tests on the IPP Client using setup from
step #1, run:

a.       root@45f0590216fc:~/ippsample/examples# ipptool -V 2.0 -tf
document-letter.pdf ipp://f8a365cfc7ec.local:631/ipp/print
ipp-everywhere.test

To run Wireshark [using tcpdump and Wireshark]

1.       Prerequisites:

a.       Start IPP server and client as described above

b.       Wireshark will need to be installed on the host

2.       On the host in a command prompt as root, run

a.       docker ps

a.       PS C:\Users\ctwhi\Documents\docker>  docker run -it -v
d:\DockerShare:/data --privileged --net container:[container ID from #2.a]
ubuntu-ippclient /usr/sbin/tcpdump -w /data/ipp.pcap

b.       After you have captured the network traffic, hit <control><C> to
break / interrupt the tcpdump process

NOTES:

*         Used Wireshark nightly build:
Wireshark-win64-2.3.0-1574-g1239336.msi that supports better IPP dissection

*         Wireshark files in C:\Users\ctwhi\OneDrive\Projects\IPP

o    Discovery [ipp-discovery.pcap]

o    Identify-printer [ipp-identify-printer.pcap]

o    Ipp-everywhere (ipptool -V 2.0 -tf document-letter.pdf
ipp://f8a365cfc7ec.local:631/ipp/print ipp-everywhere.test)
[ipp-everywhere.pcap]

I hope this is helpful.  I enjoyed learning about Docker and getting more
familiar with the IPP sample code (great work Mike).

All the best,

**CW

_______________________________________________
ipp mailing list
[email-masked]
https://www.pwg.org/mailman/listinfo/ipp

---

From: Michael Sweet <[email-masked]>
Date: Wed, 30 Nov 2016 08:04:54 -0500

Craig,

Thanks for doing this.  If you have no objections, I'll add the the docker file to the ippsample repository along with the instructions to make this more widely available.

As for the errors you are seeing when running the self-cert tools against ippserver, please file an issue in the github repository - printer-config-change-{date-time,time} are explicitly supported and should be returned, and printer-icons is normally populated with a default value.  The printer-supply* attributes are currently commented out since I haven't had a chance to update that code from the original CUPS sources which only supported a single printer and canned supplies.  We *do* want ippserver to pass the self-cert tests so it can serve as an example of a conforming implementation... :)

> On Nov 29, 2016, at 10:03 PM, Craig Whittle <[email-masked]> wrote:
> 
> All,
>  
> In between applying for new work opportunities and enjoying some time off, I created an easy way to get the IPP sample code up and running using Docker, a streamlined container / virtualization technology.  By following the steps below, you can get both an IPP client and an IPP server going on Linux, Windows 10 | Server 2016, OS/X in very little time.  The docker file pulls from the Git repository, builds the IPP sample code, and configures the container so that network traffic can be captured using tcpdump and viewed using the Wireshark on the host.  I have the capture files for some of the IPP operations using these containers if you would like these.  Using container technology enables us to have a standard way to reproduce and report issues with the IPP sample code since the environment would always be consistent.
>  
> The results of running the IPP client using the IPP everywhere test file are attached.  The test on “PWG 5100.14 section 5.1/5.2 - Required Operations and Attributes” failed.  Is this expected?  As Smith pointed out, the Docker setup / environment  is not a usable configuration for self-certification.  The greatest value a Docker-based configuration provides is a fast / easy setup that runs on multiple platforms that can be used for reference; especially if you need a common platform / environment to reproduce issues.   The Wireshark file for the IPP everywhere test and the IPP server debug message file are available upon request.  
>  
> 1.       From a shell prompt in the directory (on Windows 10|2016, OS/X, or Linux) containing this docker file run: 
> a.       docker build -t --security-opt seccomp=unconfined ubuntu[-ippserver | -ippclient] .
> b.       docker run -it -v d:\DockerShare:/data --security-opt seccomp=unconfined ubuntu-[ippclient | ippserver] bash
> 2.       From the bash prompt on the newly created container as root, start the services needed for Bonjour
> a.       /# service dbus start
> a.        /# ippserver -M byMyself -l rightHere -m coolPrinter -n myHost -p 631 -s 72 -vvvv myPrintService
> b.       run  -M byMyself -l rightHere -m coolPrinter -n myHost -p 631 -s 72 -vvvv myPrintService 
>  
> Run the IPP Client 
> 1.       From the bash command prompt on the IPP client container and in the /root/ippsample/examples directory with the IPP Server running, run:
> a.       ippfind
>                                        i.            Note the URL returned (e.g., ipp://f8a365cfc7ec.local:631/ipp/print)
> b.       ipptool [use the URL returned in step a.] identify-printer-display.test
>                                        i.            Note the "IDENTIFY from 172.17.0.4: Hello, World!"  message in stdout on the ippserver container
> 2.       To run the IPP everywhere tests on the IPP Client using setup from step #1, run:
> a.       root@45f0590216fc:~/ippsample/examples# ipptool -V 2.0 -tf document-letter.pdf ipp://f8a365cfc7ec.local:631/ipp/print ipp-everywhere.test
>   
> a.       PS C:\Users\ctwhi\Documents\docker>  docker run -it -v d:\DockerShare:/data --privileged --net container:[container ID from #2.a] ubuntu-ippclient /usr/sbin/tcpdump -w /data/ipp.pcap
> b.       After you have captured the network traffic, hit <control><C> to break / interrupt the tcpdump process
> NOTES:
> ·         Used Wireshark nightly build: Wireshark-win64-2.3.0-1574-g1239336.msi that supports better IPP dissection
> ·         Wireshark files in C:\Users\ctwhi\OneDrive\Projects\IPP
> o    Ipp-everywhere (ipptool -V 2.0 -tf document-letter.pdf ipp://f8a365cfc7ec.local:631/ipp/print ipp-everywhere.test) [ipp-everywhere.pcap]
>  
> I hope this is helpful.  I enjoyed learning about Docker and getting more familiar with the IPP sample code (great work Mike).
>  
> All the best,
>  
> **CW
>  
> <ipp.docker><2016.1129-ipp-everywhere-result.txt>_______________________________________________
> ipp mailing list
> [email-masked]

_________________________________________________________
Michael Sweet, Senior Printing System Engineer

---

From: "Kennedy, Smith (Wireless Architect)" <[email-masked]>
Date: Wed, 30 Nov 2016 14:50:54 +0000

We *do* want ippserver to pass the self-cert tests so it can serve as an example of a conforming implementation... :)

Agree! We also can offer that as a good working example of how to construct a proper full-featured "ippserver" configuration.

Cheers,
Smith
---

   Smith Kennedy
   Wireless Architect - Client Software - IPG-PPS
   Standards - PWG / Bluetooth SIG / Wi-Fi Alliance / NFC Forum
   Chair, IEEE ISTO Printer Working Group
   HP Inc.

On Nov 30, 2016, at 6:05 AM, Michael Sweet <[email-masked]<mailto:[email-masked]>> wrote:

Craig,

On Nov 29, 2016, at 10:03 PM, Craig Whittle <[email-masked]<mailto:[email-masked]>> wrote:

All,

To start the IPP Server

Run the IPP Client

All the best,

**CW

<ipp.docker><2016.1129-ipp-everywhere-result.txt>_______________________________________________
ipp mailing list
[email-masked]<mailto:[email-masked]>
https://www.pwg.org/mailman/listinfo/ipp

_______________________________________________
ipp mailing list
[email-masked]<mailto:[email-masked]>
https://www.pwg.org/mailman/listinfo/ipp
_______________________________________________
ipp mailing list
[email-masked]
https://www.pwg.org/mailman/listinfo/ipp

---

From: "Craig Whittle" <[email-masked]>
Date: Wed, 30 Nov 2016 08:07:55 -0800

Smith / Mike,

I will create issues in the GitHub repository as I see them starting with
the printer-config-change-{date-time,time} issue.   As time permits I will
isolate these issues using the Docker setup using Wireshark / gdb (included
of the Docker environment) and point out unexpected responses or suggest
specific code changes.

Happy trails,

**CW 

-----Original Message-----
From: Kennedy, Smith (Wireless Architect) [mailto:[email-masked]] 
Sent: Wednesday, November 30, 2016 6:51 AM
To: Michael Sweet <[email-masked]>
Cc: Craig Whittle <[email-masked]>; [email-masked]
Subject: Re: [IPP] Docker setup for IPP client | server

We *do* want ippserver to pass the self-cert tests so it can serve as an
example of a conforming implementation... :)

Agree! We also can offer that as a good working example of how to construct
a proper full-featured "ippserver" configuration.

Cheers,
Smith
---

   Smith Kennedy

On Nov 30, 2016, at 6:05 AM, Michael Sweet
<[email-masked]<mailto:[email-masked]>> wrote:

Craig,

Thanks for doing this.  If you have no objections, I'll add the the docker
file to the ippsample repository along with the instructions to make this
more widely available.

As for the errors you are seeing when running the self-cert tools against
ippserver, please file an issue in the github repository -
printer-config-change-{date-time,time} are explicitly supported and should
be returned, and printer-icons is normally populated with a default value.
The printer-supply* attributes are currently commented out since I haven't
had a chance to update that code from the original CUPS sources which only
supported a single printer and canned supplies.  We *do* want ippserver to
pass the self-cert tests so it can serve as an example of a conforming
implementation... :)

On Nov 29, 2016, at 10:03 PM, Craig Whittle
<[email-masked]<mailto:[email-masked]>> wrote:

All,

In between applying for new work opportunities and enjoying some time off, I
created an easy way to get the IPP sample code up and running using Docker,
a streamlined container / virtualization technology.  By following the steps
below, you can get both an IPP client and an IPP server going on Linux,
Windows 10 | Server 2016, OS/X in very little time.  The docker file pulls
from the Git repository, builds the IPP sample code, and configures the
container so that network traffic can be captured using tcpdump and viewed
using the Wireshark on the host.  I have the capture files for some of the
IPP operations using these containers if you would like these.  Using
container technology enables us to have a standard way to reproduce and
report issues with the IPP sample code since the environment would always be
consistent.

To start the IPP Server

Run the IPP Client

.         Used Wireshark nightly build:
.         Wireshark files in C:\Users\ctwhi\OneDrive\Projects\IPP

All the best,

**CW

<ipp.docker><2016.1129-ipp-everywhere-result.txt>___________________________
____________________
ipp mailing list
[email-masked]<mailto:[email-masked]>
https://www.pwg.org/mailman/listinfo/ipp